diff options
Diffstat (limited to 'include/clang/Basic/FileManager.h')
-rw-r--r-- | include/clang/Basic/FileManager.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index 7bee4c5968..b817dd20c3 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -16,7 +16,6 @@ #define LLVM_CLANG_BASIC_FILEMANAGER_H #include "clang/Basic/FileSystemOptions.h" -#include "clang/Basic/LLVM.h" #include "clang/Basic/VirtualFileSystem.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" @@ -24,22 +23,30 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/ErrorOr.h" +#include "llvm/Support/FileSystem.h" +#include <ctime> #include <memory> #include <map> +#include <string> namespace llvm { + class MemoryBuffer; -} + +} // end namespace llvm namespace clang { -class FileManager; + class FileSystemStatCache; /// \brief Cached information about one directory (either on disk or in /// the virtual file system). class DirectoryEntry { - StringRef Name; // Name of the directory. friend class FileManager; + + StringRef Name; // Name of the directory. + public: StringRef getName() const { return Name; } }; @@ -50,6 +57,8 @@ public: /// If the 'File' member is valid, then this FileEntry has an open file /// descriptor for the file. class FileEntry { + friend class FileManager; + StringRef Name; // Name of the file. std::string RealPathName; // Real path to the file; could be empty. off_t Size; // File size in bytes. @@ -63,16 +72,15 @@ class FileEntry { /// \brief The open file, if it is owned by the \p FileEntry. mutable std::unique_ptr<vfs::File> File; - friend class FileManager; - - FileEntry(const FileEntry &) = delete; - void operator=(const FileEntry &) = delete; public: FileEntry() : UniqueID(0, 0), IsNamedPipe(false), InPCH(false), IsValid(false) {} + FileEntry(const FileEntry &) = delete; + FileEntry &operator=(const FileEntry &) = delete; + StringRef getName() const { return Name; } StringRef tryGetRealPathName() const { return RealPathName; } bool isValid() const { return IsValid; } @@ -276,6 +284,6 @@ public: void PrintStats() const; }; -} // end namespace clang +} // end namespace clang -#endif +#endif // LLVM_CLANG_BASIC_FILEMANAGER_H |