r201696 - Reduce verbosity in the virtual file system using LLVM.h
Ben Langmuir
blangmuir at apple.com
Wed Feb 19 08:36:50 PST 2014
Author: benlangmuir
Date: Wed Feb 19 10:36:49 2014
New Revision: 201696
URL: http://llvm.org/viewvc/llvm-project?rev=201696&view=rev
Log:
Reduce verbosity in the virtual file system using LLVM.h
No functional change
Modified:
cfe/trunk/include/clang/Basic/FileManager.h
cfe/trunk/include/clang/Basic/VirtualFileSystem.h
cfe/trunk/lib/Basic/VirtualFileSystem.cpp
Modified: cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=201696&r1=201695&r2=201696&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Wed Feb 19 10:36:49 2014
@@ -183,7 +183,7 @@ class FileManager : public RefCountedBas
public:
FileManager(const FileSystemOptions &FileSystemOpts,
- llvm::IntrusiveRefCntPtr<vfs::FileSystem> FS = 0);
+ IntrusiveRefCntPtr<vfs::FileSystem> FS = 0);
~FileManager();
/// \brief Installs the provided FileSystemStatCache object within
Modified: cfe/trunk/include/clang/Basic/VirtualFileSystem.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/VirtualFileSystem.h?rev=201696&r1=201695&r2=201696&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/VirtualFileSystem.h (original)
+++ cfe/trunk/include/clang/Basic/VirtualFileSystem.h Wed Feb 19 10:36:49 2014
@@ -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> get
/// 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 FileSys
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
Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=201696&r1=201695&r2=201696&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Wed Feb 19 10:36:49 2014
@@ -28,10 +28,9 @@ Status::Status(const file_status &Status
User(Status.getUser()), Group(Status.getGroup()), Size(Status.getSize()),
Type(Status.type()), Perms(Status.permissions()) {}
-Status::Status(StringRef Name, StringRef ExternalName,
- UniqueID UID, sys::TimeValue MTime,
- uint32_t User, uint32_t Group, uint64_t Size,
- file_type Type, perms Perms)
+Status::Status(StringRef Name, StringRef ExternalName, UniqueID UID,
+ sys::TimeValue MTime, uint32_t User, uint32_t Group,
+ uint64_t Size, file_type Type, perms Perms)
: Name(Name), ExternalName(ExternalName), UID(UID), MTime(MTime),
User(User), Group(Group), Size(Size), Type(Type), Perms(Perms) {}
@@ -133,8 +132,8 @@ error_code RealFile::close() {
class RealFileSystem : public FileSystem {
public:
ErrorOr<Status> status(const Twine &Path) LLVM_OVERRIDE;
- error_code openFileForRead(const Twine &Path, OwningPtr<File> &Result)
- LLVM_OVERRIDE;
+ error_code openFileForRead(const Twine &Path,
+ OwningPtr<File> &Result) LLVM_OVERRIDE;
};
ErrorOr<Status> RealFileSystem::status(const Twine &Path) {
@@ -164,8 +163,7 @@ IntrusiveRefCntPtr<FileSystem> vfs::getR
//===-----------------------------------------------------------------------===/
// OverlayFileSystem implementation
//===-----------------------------------------------------------------------===/
-OverlayFileSystem::OverlayFileSystem(
- IntrusiveRefCntPtr<FileSystem> BaseFS) {
+OverlayFileSystem::OverlayFileSystem(IntrusiveRefCntPtr<FileSystem> BaseFS) {
pushOverlay(BaseFS);
}
More information about the cfe-commits
mailing list