r315212 - Set PreprocessorOpts.GeneratePreamble=true in PrecompiledPreamble.
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 9 09:52:12 PDT 2017
Author: ibiryukov
Date: Mon Oct 9 09:52:12 2017
New Revision: 315212
URL: http://llvm.org/viewvc/llvm-project?rev=315212&view=rev
Log:
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
Modified:
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=315212&r1=315211&r2=315212&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Mon Oct 9 09:52:12 2017
@@ -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.
Modified: cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp?rev=315212&r1=315211&r2=315212&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp (original)
+++ cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp Mon Oct 9 09:52:12 2017
@@ -234,6 +234,8 @@ llvm::ErrorOr<PrecompiledPreamble> Preco
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(
More information about the cfe-commits
mailing list