summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index 9572aaadb7a..b884388c0b5 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -394,11 +394,12 @@ llvm::MemoryBuffer *FileManager::
getBufferForFile(const FileEntry *Entry, std::string *ErrorStr) {
llvm::StringRef Filename = Entry->getName();
if (FileSystemOpts.WorkingDir.empty())
- return llvm::MemoryBuffer::getFile(Filename, ErrorStr);
+ return llvm::MemoryBuffer::getFile(Filename, ErrorStr, Entry->getSize());
llvm::sys::Path FilePath(Filename);
FixupRelativePath(FilePath, FileSystemOpts);
- return llvm::MemoryBuffer::getFile(FilePath.c_str(), ErrorStr);
+ return llvm::MemoryBuffer::getFile(FilePath.c_str(), ErrorStr,
+ Entry->getSize());
}
llvm::MemoryBuffer *FileManager::
OpenPOWER on IntegriCloud