aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-16 19:49:24 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-16 19:49:24 +0000
commitaa38c3d326de8f9292e188f0aeb8039254c8d683 (patch)
treeffd66634667cc2e83561064cd243ac7d31ca8e6c /lib/Lex/Preprocessor.cpp
parent3b8097a55429511e968deb5e559607561d37e0de (diff)
Teach the one caller of SourceManager::getMemoryBufferForFile() to cope with errors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98664 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 5584b18da1..880ff43c66 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -232,8 +232,9 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File,
return false;
// Load the actual file's contents.
- const MemoryBuffer *Buffer = SourceMgr.getMemoryBufferForFile(File);
- if (!Buffer)
+ bool Invalid = false;
+ const MemoryBuffer *Buffer = SourceMgr.getMemoryBufferForFile(File, &Invalid);
+ if (Invalid)
return true;
// Find the byte position of the truncation point.