Skip to content

Commit fa2a577

Browse files
bcardosolopesjrose-apple
authored andcommitted
ClangImporter: Update Swift for changes in clang (PCH + Modules issues)
This sets the NeededByPCHOrCompilationUsesPCH language option when emitting a brigding PCH. rdar://problem/35056912 rdar://problem/30384801 Initial patch by Adrian Prantl (cherry picked from commit 5d5f542)
1 parent 143c39b commit fa2a577

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
@@ -995,6 +995,7 @@ ClangImporter::create(ASTContext &ctx,
995995
if (importerOpts.Mode == ClangImporterOptions::Modes::EmbedBitcode)
996996
return importer;
997997

998+
instance.getLangOpts().NeededByPCHOrCompilationUsesPCH = true;
998999
bool canBegin = action->BeginSourceFile(instance,
9991000
instance.getFrontendOpts().Inputs[0]);
10001001
if (!canBegin)
@@ -1373,6 +1374,7 @@ ClangImporter::emitBridgingPCH(StringRef headerPath,
13731374
invocation->getFrontendOpts().OutputFile = outputPCHPath;
13741375
invocation->getFrontendOpts().ProgramAction = clang::frontend::GeneratePCH;
13751376
invocation->getPreprocessorOpts().resetNonModularOptions();
1377+
invocation->getLangOpts()->NeededByPCHOrCompilationUsesPCH = true;
13761378

13771379
clang::CompilerInstance emitInstance(
13781380
Impl.Instance->getPCHContainerOperations());

0 commit comments

Comments
 (0)