Skip to content

Commit a950321

Browse files
Merge pull request swiftlang#20238 from bcardosolopes/swift-5.0-needebypch
ClangImporter: Update Swift for changes in clang (PCH + Modules issues)
2 parents 502cc7b + bf5073f commit a950321

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ ClangImporter::create(ASTContext &ctx,
10251025
if (importerOpts.Mode == ClangImporterOptions::Modes::EmbedBitcode)
10261026
return importer;
10271027

1028+
instance.getLangOpts().NeededByPCHOrCompilationUsesPCH = true;
10281029
bool canBegin = action->BeginSourceFile(instance,
10291030
instance.getFrontendOpts().Inputs[0]);
10301031
if (!canBegin)
@@ -1405,6 +1406,7 @@ ClangImporter::emitBridgingPCH(StringRef headerPath,
14051406
invocation->getFrontendOpts().OutputFile = outputPCHPath;
14061407
invocation->getFrontendOpts().ProgramAction = clang::frontend::GeneratePCH;
14071408
invocation->getPreprocessorOpts().resetNonModularOptions();
1409+
invocation->getLangOpts()->NeededByPCHOrCompilationUsesPCH = true;
14081410

14091411
clang::CompilerInstance emitInstance(
14101412
Impl.Instance->getPCHContainerOperations());

0 commit comments

Comments
 (0)