diff options
Diffstat (limited to 'include/clang/Basic/FileManager.h')
-rw-r--r-- | include/clang/Basic/FileManager.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index 563157f..2ca344d 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_FILEMANAGER_H #include "clang/Basic/FileSystemOptions.h" +#include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" @@ -105,7 +106,7 @@ public: /// properties, such as uniquing files based on "inode", so that a file with two /// names (e.g. symlinked) will be treated as a single file. /// -class FileManager { +class FileManager : public llvm::RefCountedBase<FileManager> { FileSystemOptions FileSystemOpts; class UniqueDirContainer; @@ -176,10 +177,11 @@ public: /// const DirectoryEntry *getDirectory(llvm::StringRef DirName); - /// getFile - Lookup, cache, and verify the specified file (real or + /// \brief Lookup, cache, and verify the specified file (real or /// virtual). This returns NULL if the file doesn't exist. /// - const FileEntry *getFile(llvm::StringRef Filename); + /// \param openFile if true and the file exists, it will be opened. + const FileEntry *getFile(llvm::StringRef Filename, bool openFile = false); /// \brief Retrieve a file entry for a "virtual" file that acts as /// if there were a file with the given name on disk. The file @@ -194,13 +196,16 @@ public: llvm::MemoryBuffer *getBufferForFile(llvm::StringRef Filename, std::string *ErrorStr = 0); + // getNoncachedStatValue - Will get the 'stat' information for the given path. + // If the path is relative, it will be resolved against the WorkingDir of the + // FileManager's FileSystemOptions. + bool getNoncachedStatValue(llvm::StringRef Path, struct stat &StatBuf); + /// \brief If path is not absolute and FileSystemOptions set the working /// directory, the path is modified to be relative to the given /// working directory. - static void FixupRelativePath(llvm::sys::Path &path, - const FileSystemOptions &FSOpts); + void FixupRelativePath(llvm::SmallVectorImpl<char> &path) const; - /// \brief Produce an array mapping from the unique IDs assigned to each /// file to the corresponding FileEntry pointer. void GetUniqueIDMapping( |