diff options
author | Ben Langmuir <blangmuir@apple.com> | 2014-02-19 16:36:49 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2014-02-19 16:36:49 +0000 |
commit | 05d56ef2c5241802b9a371fcce19759fd6ee789b (patch) | |
tree | 55c6651514920560070b5f3c269a398127920389 /include/clang/Basic/VirtualFileSystem.h | |
parent | 8785edcaa698844e989c9339faf92cf1e106af8a (diff) | |
download | clang-05d56ef2c5241802b9a371fcce19759fd6ee789b.tar.gz clang-05d56ef2c5241802b9a371fcce19759fd6ee789b.tar.bz2 clang-05d56ef2c5241802b9a371fcce19759fd6ee789b.tar.xz |
Reduce verbosity in the virtual file system using LLVM.h
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/VirtualFileSystem.h')
-rw-r--r-- | include/clang/Basic/VirtualFileSystem.h | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h index 6dd9bf73b3..694c6ddec8 100644 --- a/include/clang/Basic/VirtualFileSystem.h +++ b/include/clang/Basic/VirtualFileSystem.h @@ -13,12 +13,12 @@ #ifndef LLVM_CLANG_BASIC_VIRTUAL_FILE_SYSTEM_H #define LLVM_CLANG_BASIC_VIRTUAL_FILE_SYSTEM_H +#include "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/ErrorOr.h" namespace llvm { -template <typename T> class OwningPtr; class MemoryBuffer; } @@ -40,21 +40,21 @@ class Status { public: Status() : Type(llvm::sys::fs::file_type::status_error) {} Status(const llvm::sys::fs::file_status &Status); - Status(llvm::StringRef Name, llvm::StringRef RealName, - llvm::sys::fs::UniqueID UID, llvm::sys::TimeValue MTime, - uint32_t User, uint32_t Group, uint64_t Size, - llvm::sys::fs::file_type Type, llvm::sys::fs::perms Perms); + Status(StringRef Name, StringRef RealName, llvm::sys::fs::UniqueID UID, + llvm::sys::TimeValue MTime, uint32_t User, uint32_t Group, + uint64_t Size, llvm::sys::fs::file_type Type, + llvm::sys::fs::perms Perms); /// \brief Returns the name this status was looked up by. - llvm::StringRef getName() const { return Name; } + StringRef getName() const { return Name; } /// \brief Returns the name to use outside the compiler. /// /// For example, in diagnostics or debug info we should use this name. - llvm::StringRef getExternalName() const { return ExternalName; } + StringRef getExternalName() const { return ExternalName; } - void setName(llvm::StringRef N) { Name = N; } - void setExternalName(llvm::StringRef N) { ExternalName = N; } + void setName(StringRef N) { Name = N; } + void setExternalName(StringRef N) { ExternalName = N; } /// @name Status interface from llvm::sys::fs /// @{ @@ -91,36 +91,36 @@ public: /// \brief Get the status of the file. virtual llvm::ErrorOr<Status> status() = 0; /// \brief Get the contents of the file as a \p MemoryBuffer. - virtual llvm::error_code - getBuffer(const llvm::Twine &Name, - llvm::OwningPtr<llvm::MemoryBuffer> &Result, int64_t FileSize = -1, - bool RequiresNullTerminator = true) = 0; + virtual llvm::error_code getBuffer(const Twine &Name, + OwningPtr<llvm::MemoryBuffer> &Result, + int64_t FileSize = -1, + bool RequiresNullTerminator = true) = 0; /// \brief Closes the file. virtual llvm::error_code close() = 0; }; /// \brief The virtual file system interface. -class FileSystem : public llvm::RefCountedBase<FileSystem> { +class FileSystem : public RefCountedBase<FileSystem> { public: virtual ~FileSystem(); /// \brief Get the status of the entry at \p Path, if one exists. - virtual llvm::ErrorOr<Status> status(const llvm::Twine &Path) = 0; + virtual llvm::ErrorOr<Status> status(const Twine &Path) = 0; /// \brief Get a \p File object for the file at \p Path, if one exists. - virtual llvm::error_code openFileForRead(const llvm::Twine &Path, - llvm::OwningPtr<File> &Result) = 0; + virtual llvm::error_code openFileForRead(const Twine &Path, + OwningPtr<File> &Result) = 0; /// This is a convenience method that opens a file, gets its content and then /// closes the file. - llvm::error_code getBufferForFile(const llvm::Twine &Name, - llvm::OwningPtr<llvm::MemoryBuffer> &Result, + llvm::error_code getBufferForFile(const Twine &Name, + OwningPtr<llvm::MemoryBuffer> &Result, int64_t FileSize = -1, bool RequiresNullTerminator = true); }; /// \brief Gets an \p vfs::FileSystem for the 'real' file system, as seen by /// the operating system. -llvm::IntrusiveRefCntPtr<FileSystem> getRealFileSystem(); +IntrusiveRefCntPtr<FileSystem> getRealFileSystem(); /// \brief A file system that allows overlaying one \p AbstractFileSystem on top /// of another. @@ -133,8 +133,7 @@ llvm::IntrusiveRefCntPtr<FileSystem> getRealFileSystem(); /// that exists in more than one file system, the file in the top-most file /// system overrides the other(s). class OverlayFileSystem : public FileSystem { - typedef llvm::SmallVector<llvm::IntrusiveRefCntPtr<FileSystem>, 1> - FileSystemList; + typedef SmallVector<IntrusiveRefCntPtr<FileSystem>, 1> FileSystemList; typedef FileSystemList::reverse_iterator iterator; /// \brief The stack of file systems, implemented as a list in order of @@ -149,13 +148,13 @@ class OverlayFileSystem : public FileSystem { iterator overlays_end() { return FSList.rend(); } public: - OverlayFileSystem(llvm::IntrusiveRefCntPtr<FileSystem> Base); + OverlayFileSystem(IntrusiveRefCntPtr<FileSystem> Base); /// \brief Pushes a file system on top of the stack. - void pushOverlay(llvm::IntrusiveRefCntPtr<FileSystem> FS); + void pushOverlay(IntrusiveRefCntPtr<FileSystem> FS); - llvm::ErrorOr<Status> status(const llvm::Twine &Path) LLVM_OVERRIDE; - llvm::error_code openFileForRead(const llvm::Twine &Path, - llvm::OwningPtr<File> &Result) LLVM_OVERRIDE; + llvm::ErrorOr<Status> status(const Twine &Path) LLVM_OVERRIDE; + llvm::error_code openFileForRead(const Twine &Path, + OwningPtr<File> &Result) LLVM_OVERRIDE; }; } // end namespace vfs |