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 | 63ceaa32a2371e38d1f912080fe471285e6b6e56 (patch) | |
tree | e74087557214e26a0d860bbd6311142c73962f85 /lib/Lex/Preprocessor.cpp | |
parent | 21a8bed504a95df019771ab1a3dc9ecccfd9cfaa (diff) |
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/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 229826af5d..49a25f2574 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -438,7 +438,9 @@ void Preprocessor::EnterMainSourceFile() { FileID MainFileID = SourceMgr.getMainFileID(); // Enter the main file source buffer. - EnterSourceFile(MainFileID, 0); + std::string ErrorStr; + bool Res = EnterSourceFile(MainFileID, 0, ErrorStr); + assert(!Res && "Entering main file should not fail!"); // Tell the header info that the main file was entered. If the file is later // #imported, it won't be re-entered. @@ -464,7 +466,8 @@ void Preprocessor::EnterMainSourceFile() { assert(!FID.isInvalid() && "Could not create FileID for predefines?"); // Start parsing the predefines. - EnterSourceFile(FID, 0); + Res = EnterSourceFile(FID, 0, ErrorStr); + assert(!Res && "Entering predefines should not fail!"); } |