diff options
author | Alp Toker <alp@nuanti.com> | 2014-05-02 03:43:30 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-05-02 03:43:30 +0000 |
commit | 1ae02f68bea80c5114b808455b922667339f4c90 (patch) | |
tree | 214507eed3fc56622146dcfaf9962ac5043a71a7 /clang/lib/Frontend | |
parent | 23aa3532919dfcfea2b12fbd8c8d8b820104744c (diff) | |
download | bcm5719-llvm-1ae02f68bea80c5114b808455b922667339f4c90.tar.gz bcm5719-llvm-1ae02f68bea80c5114b808455b922667339f4c90.zip |
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
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 5 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 009b200472b..6437c3e8b24 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -718,11 +718,10 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, 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 aa2e07e668b..d20c1a417e8 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -240,11 +240,11 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) { 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 |