diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-06 09:19:12 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-06 09:19:12 +0000 |
commit | 1776679e71c7bde5c735b94a9d7bd8a1a5bc9fb9 (patch) | |
tree | 0b002b29f6ce7deeea94025ad8dac95814633c8a /clang/lib/Lex/PPLexerChange.cpp | |
parent | 7cea5f1747045a5d52387920560937b8b30b2171 (diff) | |
download | bcm5719-llvm-1776679e71c7bde5c735b94a9d7bd8a1a5bc9fb9.tar.gz bcm5719-llvm-1776679e71c7bde5c735b94a9d7bd8a1a5bc9fb9.zip |
Change Preprocessor::EnterSourceFile to make ErrorStr non-optional, clients should be forced to deal with error conditions.
llvm-svn: 90700
Diffstat (limited to 'clang/lib/Lex/PPLexerChange.cpp')
-rw-r--r-- | clang/lib/Lex/PPLexerChange.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index 1580b87dac6..5cdfeafa33c 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/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); |