diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-16 20:01:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-16 20:01:30 +0000 |
commit | aae58b0c3efb5fa9f97a3e4b1c1a2d31077efe5b (patch) | |
tree | 7bb2509f9b232b68f5a3d23be712a7be2462d946 /lib/Lex/PPLexerChange.cpp | |
parent | aa38c3d326de8f9292e188f0aeb8039254c8d683 (diff) |
Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover
gracefully from failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r-- | lib/Lex/PPLexerChange.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp index 81e6bf8090..6d1c132fc0 100644 --- a/lib/Lex/PPLexerChange.cpp +++ b/lib/Lex/PPLexerChange.cpp @@ -80,8 +80,10 @@ bool Preprocessor::EnterSourceFile(FileID FID, const DirectoryLookup *CurDir, } // Get the MemoryBuffer for this FID, if it fails, we fail. - const llvm::MemoryBuffer *InputFile = getSourceManager().getBuffer(FID); - if (!InputFile) + bool Invalid = false; + const llvm::MemoryBuffer *InputFile = getSourceManager().getBuffer(FID, + &Invalid); + if (Invalid) return true; EnterSourceFileWithLexer(new Lexer(FID, InputFile, *this), CurDir); |