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
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 229826a..49a25f2 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -438,7 +438,9 @@
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 @@
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!");
}