Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 5dbb2b9

Browse files
committed
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315212 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8ea201f commit 5dbb2b9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/Frontend/ASTUnit.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,6 @@ ASTUnit *ASTUnit::LoadFromCommandLine(
16981698
PreprocessorOptions &PPOpts = CI->getPreprocessorOpts();
16991699
PPOpts.RemappedFilesKeepOriginalName = RemappedFilesKeepOriginalName;
17001700
PPOpts.AllowPCHWithCompilerErrors = AllowPCHWithCompilerErrors;
1701-
PPOpts.GeneratePreamble = PrecompilePreambleAfterNParses != 0;
17021701
PPOpts.SingleFileParseMode = SingleFileParse;
17031702

17041703
// Override the resources path.

lib/Frontend/PrecompiledPreamble.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ llvm::ErrorOr<PrecompiledPreamble> PrecompiledPreamble::Build(
234234
FrontendOpts.OutputFile = PreamblePCHFile->getFilePath();
235235
PreprocessorOpts.PrecompiledPreambleBytes.first = 0;
236236
PreprocessorOpts.PrecompiledPreambleBytes.second = false;
237+
// Inform preprocessor to record conditional stack when building the preamble.
238+
PreprocessorOpts.GeneratePreamble = true;
237239

238240
// Create the compiler instance to use for building the precompiled preamble.
239241
std::unique_ptr<CompilerInstance> Clang(

0 commit comments

Comments
 (0)