summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2017-10-09 16:52:12 +0000
committerIlya Biryukov <ibiryukov@google.com>2017-10-09 16:52:12 +0000
commiteb1ec876b3edd7005606e9802973f69a045fe511 (patch)
treeb2b216ab15e0299c3fe8e827d501b533075f5386 /clang/lib
parent08e6ccbcf3349121bf7eb8b9abe6610abcd452dd (diff)
downloadbcm5719-llvm-eb1ec876b3edd7005606e9802973f69a045fe511.tar.gz
bcm5719-llvm-eb1ec876b3edd7005606e9802973f69a045fe511.zip
Set PreprocessorOpts.GeneratePreamble=true in PrecompiledPreamble.
Summary: It was previsouly set only in ASTUnit, but it should be set for all client of PrecompiledPreamble. Reviewers: erikjv, bkramer, klimek Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38617 llvm-svn: 315212
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp1
-rw-r--r--clang/lib/Frontend/PrecompiledPreamble.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index b644ef81222..9eeec37a758 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1698,7 +1698,6 @@ ASTUnit *ASTUnit::LoadFromCommandLine(
PreprocessorOptions &PPOpts = CI->getPreprocessorOpts();
PPOpts.RemappedFilesKeepOriginalName = RemappedFilesKeepOriginalName;
PPOpts.AllowPCHWithCompilerErrors = AllowPCHWithCompilerErrors;
- PPOpts.GeneratePreamble = PrecompilePreambleAfterNParses != 0;
PPOpts.SingleFileParseMode = SingleFileParse;
// Override the resources path.
diff --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp
index bd6770acdff..81466d0c286 100644
--- a/clang/lib/Frontend/PrecompiledPreamble.cpp
+++ b/clang/lib/Frontend/PrecompiledPreamble.cpp
@@ -234,6 +234,8 @@ llvm::ErrorOr<PrecompiledPreamble> PrecompiledPreamble::Build(
FrontendOpts.OutputFile = PreamblePCHFile->getFilePath();
PreprocessorOpts.PrecompiledPreambleBytes.first = 0;
PreprocessorOpts.PrecompiledPreambleBytes.second = false;
+ // Inform preprocessor to record conditional stack when building the preamble.
+ PreprocessorOpts.GeneratePreamble = true;
// Create the compiler instance to use for building the precompiled preamble.
std::unique_ptr<CompilerInstance> Clang(
OpenPOWER on IntegriCloud