summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/VirtualFileSystem.h
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-10-06 10:04:08 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-10-06 10:04:08 +0000
commit9aa66ec1710f4f8e01f3e0bf699f03da093099a3 (patch)
tree8f5da9e8e40ca52b265f5161b851a1920f913389 /include/clang/Basic/VirtualFileSystem.h
parentc160cb00f33c2a708d0901fe55820023a8fb7e8c (diff)
[VFS] Transition clang-format to use an in-memory FS.
Apart from being cleaner this also means that clang-format no longer has access to the host file system. This isn't necessary because clang-format never reads includes :) Includes minor tweaks and bugfixes found in the VFS implementation while running clang-format tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/VirtualFileSystem.h')
-rw-r--r--include/clang/Basic/VirtualFileSystem.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h
index 52bcce2cd1..36a14b794c 100644
--- a/include/clang/Basic/VirtualFileSystem.h
+++ b/include/clang/Basic/VirtualFileSystem.h
@@ -274,8 +274,12 @@ class InMemoryFileSystem : public FileSystem {
public:
InMemoryFileSystem();
~InMemoryFileSystem() override;
+ /// Add a buffer to the VFS with a path. The VFS owns the buffer.
void addFile(const Twine &Path, time_t ModificationTime,
std::unique_ptr<llvm::MemoryBuffer> Buffer);
+ /// Add a buffer to the VFS with a path. The VFS does not own the buffer.
+ void addFileNoOwn(const Twine &Path, time_t ModificationTime,
+ llvm::MemoryBuffer *Buffer);
StringRef toString() const;
llvm::ErrorOr<Status> status(const Twine &Path) override;