Skip to content

Commit da8a1c5

Browse files
committed
ClangImporter: Use the new CacheGeneratedPCH in Clang
This flag causes the generated PCH to be written into the in-memory module cache. Every CompilerInstance that tries to read the PCH will use it rather than reading a potentially-since-overwritten version from the filesystem. rdar://problem/48740787 (cherry picked from commit 236fc19)
1 parent a42bc62 commit da8a1c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,7 @@ ClangImporter::emitBridgingPCH(StringRef headerPath,
14401440
invocation->getFrontendOpts().ProgramAction = clang::frontend::GeneratePCH;
14411441
invocation->getPreprocessorOpts().resetNonModularOptions();
14421442
invocation->getLangOpts()->NeededByPCHOrCompilationUsesPCH = true;
1443+
invocation->getLangOpts()->CacheGeneratedPCH = true;
14431444

14441445
clang::CompilerInstance emitInstance(
14451446
Impl.Instance->getPCHContainerOperations(),

0 commit comments

Comments
 (0)