diff options
Diffstat (limited to 'contrib/llvm/tools/clang/include/clang/Basic/FileManager.h')
-rw-r--r-- | contrib/llvm/tools/clang/include/clang/Basic/FileManager.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h b/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h index b2f578d..6d9e53b 100644 --- a/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h +++ b/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h @@ -17,11 +17,12 @@ #include "clang/Basic/FileSystemOptions.h" #include "clang/Basic/LLVM.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/Support/Allocator.h" // FIXME: Enhance libsystem to support inode and other fields in stat. #include <sys/types.h> @@ -152,6 +153,12 @@ class FileManager : public RefCountedBase<FileManager> { /// \see SeenDirEntries llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator> SeenFileEntries; + /// \brief The canonical names of directories. + llvm::DenseMap<const DirectoryEntry *, llvm::StringRef> CanonicalDirNames; + + /// \brief Storage for canonical names that we have computed. + llvm::BumpPtrAllocator CanonicalNameStorage; + /// \brief Each FileEntry we create is assigned a unique ID #. /// unsigned NextFileUID; @@ -164,7 +171,7 @@ class FileManager : public RefCountedBase<FileManager> { OwningPtr<FileSystemStatCache> StatCache; bool getStatValue(const char *Path, struct stat &StatBuf, - int *FileDescriptor); + bool isFile, int *FileDescriptor); /// Add all ancestors of the given path (pointing to either a file /// or a directory) as virtual directories. @@ -257,6 +264,13 @@ public: static void modifyFileEntry(FileEntry *File, off_t Size, time_t ModificationTime); + /// \brief Retrieve the canonical name for a given directory. + /// + /// This is a very expensive operation, despite its results being cached, + /// and should only be used when the physical layout of the file system is + /// required, which is (almost) never. + StringRef getCanonicalName(const DirectoryEntry *Dir); + void PrintStats() const; }; |