aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-22 23:51:00 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-22 23:51:00 +0000
commit38295beb73db5f90bfcf31625fb81dbc3b96290a (patch)
tree224a65bc0169fc16d0a1a6b3bfccabfd3cd9df4d /lib/Frontend/ASTUnit.cpp
parent8b53d141ee5a91da92c4196ed7ad4142e1009d6f (diff)
Allow clients of the AST reader to specify what kinds of AST load
failures they know how to tolerate, e.g., out-of-date input files or configuration/version mismatches. Suppress the corresponding diagnostics if the client can handle it. No clients actually use this functionality, yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 11bd33ec41..a340d7db33 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -524,7 +524,8 @@ public:
InitializedLanguage(false) {}
virtual bool ReadLanguageOptions(const serialization::ModuleFile &M,
- const LangOptions &LangOpts) {
+ const LangOptions &LangOpts,
+ bool Complain) {
if (InitializedLanguage)
return false;
@@ -538,7 +539,8 @@ public:
}
virtual bool ReadTargetOptions(const serialization::ModuleFile &M,
- const TargetOptions &TargetOpts) {
+ const TargetOptions &TargetOpts,
+ bool Complain) {
// If we've already initialized the target, don't do it again.
if (Target)
return false;
@@ -557,7 +559,8 @@ public:
virtual bool ReadPredefinesBuffer(const PCHPredefinesBlocks &Buffers,
StringRef OriginalFileName,
std::string &SuggestedPredefines,
- FileManager &FileMgr) {
+ FileManager &FileMgr,
+ bool Complain) {
Predefines = Buffers[0].Data;
for (unsigned I = 1, N = Buffers.size(); I != N; ++I) {
Predefines += Buffers[I].Data;
@@ -809,7 +812,8 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
AST->TargetOpts, AST->Target,
Predefines, Counter));
- switch (Reader->ReadAST(Filename, serialization::MK_MainFile)) {
+ switch (Reader->ReadAST(Filename, serialization::MK_MainFile,
+ ASTReader::ARR_None)) {
case ASTReader::Success:
break;