[Basic/FileManager] Propagate whether a file 'IsVolatile' to the file opening functions.

Needs llvm r208007.

llvm-svn: 208008
This commit is contained in:
Argyrios Kyrtzidis
2014-05-05 21:57:46 +00:00
parent 20a92ae3d2
commit 26d56393c6
3 changed files with 19 additions and 10 deletions

View File

@@ -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();