Factor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctor
The Preprocessor::Initialize() function already offers a clear interface to
achieve this, further reducing the confusing number of states a newly
constructed preprocessor can have.
llvm-svn: 207825
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 009b200..6437c3e 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -718,11 +718,10 @@
AST->PP = new Preprocessor(PPOpts,
AST->getDiagnostics(), AST->ASTFileLangOpts,
- /*Target=*/0, AST->getSourceManager(), HeaderInfo,
+ AST->getSourceManager(), HeaderInfo,
*AST,
/*IILookup=*/0,
- /*OwnsHeaderSearch=*/false,
- /*DelayInitialization=*/true);
+ /*OwnsHeaderSearch=*/false);
Preprocessor &PP = *AST->PP;
AST->Ctx = new ASTContext(AST->ASTFileLangOpts,
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index aa2e07e..d20c1a4 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -240,11 +240,11 @@
getLangOpts(),
&getTarget());
PP = new Preprocessor(&getPreprocessorOpts(),
- getDiagnostics(), getLangOpts(), &getTarget(),
+ getDiagnostics(), getLangOpts(),
getSourceManager(), *HeaderInfo, *this, PTHMgr,
/*OwnsHeaderSearch=*/true,
- /*DelayInitialization=*/false,
TUKind);
+ PP->Initialize(getTarget());
// Note that this is different then passing PTHMgr to Preprocessor's ctor.
// That argument is used as the IdentifierInfoLookup argument to