diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-24 17:46:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-24 17:46:57 +0000 |
commit | 36a16498ff911a218f26c7955376bbe99ddb16df (patch) | |
tree | 2fdb0de1a2d826516f6a6103de4ba9850b130d6b /lib/Frontend | |
parent | 42242552fe9769fba3c1a1f82e181688675908f0 (diff) |
Teach the preprocessor to hold onto the preprocessor options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166599 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 39b3437fc5..410b7e6195 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -27,6 +27,7 @@ #include "clang/Serialization/ASTWriter.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/Preprocessor.h" +#include "clang/Lex/PreprocessorOptions.h" #include "clang/Basic/TargetOptions.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/Diagnostic.h" @@ -772,7 +773,8 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, OwningPtr<ASTReader> Reader; - AST->PP = new Preprocessor(AST->getDiagnostics(), AST->ASTFileLangOpts, + AST->PP = new Preprocessor(new PreprocessorOptions(), + AST->getDiagnostics(), AST->ASTFileLangOpts, /*Target=*/0, AST->getSourceManager(), HeaderInfo, *AST, /*IILookup=*/0, diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 4b6a2fc888..fca9f0ba57 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -247,7 +247,8 @@ void CompilerInstance::createPreprocessor() { getDiagnostics(), getLangOpts(), &getTarget()); - PP = new Preprocessor(getDiagnostics(), getLangOpts(), &getTarget(), + PP = new Preprocessor(&getPreprocessorOpts(), + getDiagnostics(), getLangOpts(), &getTarget(), getSourceManager(), *HeaderInfo, *this, PTHMgr, /*OwnsHeaderSearch=*/true); |