diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 17:01:53 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 17:01:53 +0000 |
commit | 9d88d1aaab145e18c8e0fe93544f8a1ff0474866 (patch) | |
tree | 76878e5c34075b7fb47f4cc78dc6636840922da0 /include/llvm | |
parent | 4251ce4b10a35552df67ea624b180ad247960eef (diff) | |
download | external_llvm-9d88d1aaab145e18c8e0fe93544f8a1ff0474866.zip external_llvm-9d88d1aaab145e18c8e0fe93544f8a1ff0474866.tar.gz external_llvm-9d88d1aaab145e18c8e0fe93544f8a1ff0474866.tar.bz2 |
For PR351: \
The getFileTimestamp and getFileSize functions have been removed from \
FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \
Path::getSize,respectively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Debugger/ProgramInfo.h | 5 | ||||
-rw-r--r-- | include/llvm/Support/FileUtilities.h | 11 | ||||
-rw-r--r-- | include/llvm/System/Path.h | 15 |
3 files changed, 18 insertions, 13 deletions
diff --git a/include/llvm/Debugger/ProgramInfo.h b/include/llvm/Debugger/ProgramInfo.h index 4420e72..f7ee77d 100644 --- a/include/llvm/Debugger/ProgramInfo.h +++ b/include/llvm/Debugger/ProgramInfo.h @@ -21,6 +21,7 @@ #ifndef LLVM_DEBUGGER_PROGRAMINFO_H #define LLVM_DEBUGGER_PROGRAMINFO_H +#include "llvm/System/TimeValue.h" #include <string> #include <map> #include <vector> @@ -133,7 +134,7 @@ namespace llvm { /// ProgramTimeStamp - This is the timestamp of the executable file that we /// currently have loaded into the debugger. - unsigned long long ProgramTimeStamp; + sys::TimeValue ProgramTimeStamp; /// SourceFiles - This map is used to transform source file descriptors into /// their corresponding SourceFileInfo objects. This mapping owns the @@ -170,7 +171,7 @@ namespace llvm { /// getProgramTimeStamp - Return the time-stamp of the program when it was /// loaded. - unsigned long long getProgramTimeStamp() const { return ProgramTimeStamp; } + sys::TimeValue getProgramTimeStamp() const { return ProgramTimeStamp; } //===------------------------------------------------------------------===// // Interfaces to the source code files that make up the program. diff --git a/include/llvm/Support/FileUtilities.h b/include/llvm/Support/FileUtilities.h index f61ee7c..885ee86 100644 --- a/include/llvm/Support/FileUtilities.h +++ b/include/llvm/Support/FileUtilities.h @@ -61,17 +61,6 @@ bool MakeFileExecutable(const std::string &Filename); /// bool MakeFileReadable(const std::string &Filename); -/// getFileSize - Return the size of the specified file in bytes, or -1 if the -/// file cannot be read or does not exist. -long long getFileSize(const std::string &Filename); - - -/// getFileTimestamp - Get the last modified time for the specified file in an -/// unspecified format. This is useful to allow checking to see if a file was -/// updated since that last time the timestampt was aquired. If the file does -/// not exist or there is an error getting the time-stamp, zero is returned. -unsigned long long getFileTimestamp(const std::string &Filename); - /// ReadFileIntoAddressSpace - Attempt to map the specific file into the /// address space of the current process for reading. If this succeeds, /// return the address of the buffer and the length of the file mapped. On diff --git a/include/llvm/System/Path.h b/include/llvm/System/Path.h index 10c8bcc..57cbc6c 100644 --- a/include/llvm/System/Path.h +++ b/include/llvm/System/Path.h @@ -376,6 +376,21 @@ namespace sys { /// @brief Get file status. void getStatusInfo(StatusInfo& info) const; + /// This function returns the last modified time stamp for the file + /// referenced by this path. The Path may reference a file or a directory. + /// If the file does not exist, a ZeroTime timestamp is returned. + /// @returns last modified timestamp of the file/directory or ZeroTime + /// @brief Get file timestamp. + inline TimeValue getTimestamp() const { + StatusInfo info; getStatusInfo(info); return info.modTime; + } + + /// This function returns the size of the file referenced by this path. + /// @brief Get file size. + inline size_t getSize() const { + StatusInfo info; getStatusInfo(info); return info.fileSize; + } + /// This method attempts to set the Path object to \p unverified_path /// and interpret the name as a directory name. The \p unverified_path /// is verified. If verification succeeds then \p unverified_path |