summaryrefslogtreecommitdiff
path: root/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-05-05 21:57:46 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-05-05 21:57:46 +0000
commitbd80493223a2507f989add766fe27aa72a787d5a (patch)
treea9b2b5653ef6e898e820dca8bb705b4c994b037e /lib/Basic/FileManager.cpp
parent57973be024e1b0cb252ae43ddc05d4ce4203b1f1 (diff)
downloadclang-bd80493223a2507f989add766fe27aa72a787d5a.tar.gz
clang-bd80493223a2507f989add766fe27aa72a787d5a.tar.bz2
clang-bd80493223a2507f989add766fe27aa72a787d5a.tar.xz
[Basic/FileManager] Propagate whether a file 'IsVolatile' to the file opening functions.
Needs llvm r208007. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/FileManager.cpp')
-rw-r--r--lib/Basic/FileManager.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp
index 579c8185b3..5d7d9390d2 100644
--- a/lib/Basic/FileManager.cpp
+++ b/lib/Basic/FileManager.cpp
@@ -391,7 +391,8 @@ getBufferForFile(const FileEntry *Entry, std::string *ErrorStr,
const char *Filename = Entry->getName();
// If the file is already open, use the open file descriptor.
if (Entry->File) {
- ec = Entry->File->getBuffer(Filename, Result, FileSize);
+ ec = Entry->File->getBuffer(Filename, Result, FileSize,
+ /*RequiresNullTerminator=*/true, isVolatile);
if (ErrorStr)
*ErrorStr = ec.message();
Entry->closeFile();
@@ -401,7 +402,8 @@ getBufferForFile(const FileEntry *Entry, std::string *ErrorStr,
// Otherwise, open the file.
if (FileSystemOpts.WorkingDir.empty()) {
- ec = FS->getBufferForFile(Filename, Result, FileSize);
+ ec = FS->getBufferForFile(Filename, Result, FileSize,
+ /*RequiresNullTerminator=*/true, isVolatile);
if (ec && ErrorStr)
*ErrorStr = ec.message();
return Result.release();
@@ -409,7 +411,8 @@ getBufferForFile(const FileEntry *Entry, std::string *ErrorStr,
SmallString<128> FilePath(Entry->getName());
FixupRelativePath(FilePath);
- ec = FS->getBufferForFile(FilePath.str(), Result, FileSize);
+ ec = FS->getBufferForFile(FilePath.str(), Result, FileSize,
+ /*RequiresNullTerminator=*/true, isVolatile);
if (ec && ErrorStr)
*ErrorStr = ec.message();
return Result.release();