diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-20 06:58:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-20 06:58:45 +0000 |
commit | 686775deca8b8685eb90801495880e3abdd844c2 (patch) | |
tree | 64e6e34d0e6d1078631305a3f1ac1dfb821f4a59 /include/clang/Basic/FileManager.h | |
parent | 9594675cc1eb52a054de13c4a21e466643847480 (diff) |
now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector. This cleans up the codebase
quite a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/FileManager.h')
-rw-r--r-- | include/clang/Basic/FileManager.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index 1324533fa0..bab05acba0 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 "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" @@ -123,9 +124,9 @@ class FileManager : public llvm::RefCountedBase<FileManager> { /// \brief The virtual directories that we have allocated. For each /// virtual file (e.g. foo/bar/baz.cpp), we add all of its parent /// directories (foo/ and foo/bar/) here. - llvm::SmallVector<DirectoryEntry*, 4> VirtualDirectoryEntries; + SmallVector<DirectoryEntry*, 4> VirtualDirectoryEntries; /// \brief The virtual files that we have allocated. - llvm::SmallVector<FileEntry*, 4> VirtualFileEntries; + SmallVector<FileEntry*, 4> VirtualFileEntries; /// SeenDirEntries/SeenFileEntries - This is a cache that maps paths /// to directory/file entries (either real or virtual) we have @@ -153,7 +154,7 @@ class FileManager : public llvm::RefCountedBase<FileManager> { /// Add all ancestors of the given path (pointing to either a file /// or a directory) as virtual directories. - void addAncestorsAsVirtualDirs(llvm::StringRef Path); + void addAncestorsAsVirtualDirs(StringRef Path); public: FileManager(const FileSystemOptions &FileSystemOpts); @@ -178,41 +179,41 @@ public: /// getDirectory - Lookup, cache, and verify the specified directory /// (real or virtual). This returns NULL if the directory doesn't exist. /// - const DirectoryEntry *getDirectory(llvm::StringRef DirName); + const DirectoryEntry *getDirectory(StringRef DirName); /// \brief Lookup, cache, and verify the specified file (real or /// virtual). This returns NULL if the file doesn't exist. /// /// \param openFile if true and the file exists, it will be opened. - const FileEntry *getFile(llvm::StringRef Filename, bool openFile = false); + const FileEntry *getFile(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 /// itself is not accessed. - const FileEntry *getVirtualFile(llvm::StringRef Filename, off_t Size, + const FileEntry *getVirtualFile(StringRef Filename, off_t Size, time_t ModificationTime); /// \brief Open the specified file as a MemoryBuffer, returning a new /// MemoryBuffer if successful, otherwise returning null. llvm::MemoryBuffer *getBufferForFile(const FileEntry *Entry, std::string *ErrorStr = 0); - llvm::MemoryBuffer *getBufferForFile(llvm::StringRef Filename, + llvm::MemoryBuffer *getBufferForFile(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); + bool getNoncachedStatValue(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. - void FixupRelativePath(llvm::SmallVectorImpl<char> &path) const; + void FixupRelativePath(SmallVectorImpl<char> &path) const; /// \brief Produce an array mapping from the unique IDs assigned to each /// file to the corresponding FileEntry pointer. void GetUniqueIDMapping( - llvm::SmallVectorImpl<const FileEntry *> &UIDToFiles) const; + SmallVectorImpl<const FileEntry *> &UIDToFiles) const; void PrintStats() const; }; |