summaryrefslogtreecommitdiff
path: root/lib/Lex/PPLexerChange.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-06 09:19:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-06 09:19:12 +0000
commit63ceaa32a2371e38d1f912080fe471285e6b6e56 (patch)
treee74087557214e26a0d860bbd6311142c73962f85 /lib/Lex/PPLexerChange.cpp
parent21a8bed504a95df019771ab1a3dc9ecccfd9cfaa (diff)
downloadclang-63ceaa32a2371e38d1f912080fe471285e6b6e56.tar.gz
clang-63ceaa32a2371e38d1f912080fe471285e6b6e56.tar.bz2
clang-63ceaa32a2371e38d1f912080fe471285e6b6e56.tar.xz
Change Preprocessor::EnterSourceFile to make ErrorStr non-optional, clients should be forced to deal with error conditions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r--lib/Lex/PPLexerChange.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp
index 1580b87dac..5cdfeafa33 100644
--- a/lib/Lex/PPLexerChange.cpp
+++ b/lib/Lex/PPLexerChange.cpp
@@ -65,7 +65,7 @@ PreprocessorLexer *Preprocessor::getCurrentFileLexer() const {
/// EnterSourceFile - Add a source file to the top of the include stack and
/// start lexing tokens from it instead of the current buffer.
bool Preprocessor::EnterSourceFile(FileID FID, const DirectoryLookup *CurDir,
- std::string *ErrorStr) {
+ std::string &ErrorStr) {
assert(CurTokenLexer == 0 && "Cannot #include a file inside a macro!");
++NumEnteredSourceFiles;
@@ -81,8 +81,8 @@ 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, ErrorStr);
if (InputFile == 0)
+ getSourceManager().getBuffer(FID, &ErrorStr);
return true;
EnterSourceFileWithLexer(new Lexer(FID, InputFile, *this), CurDir);