Skip to content

Commit ae98269

Browse files
committed
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
1 parent f2049df commit ae98269

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
@@ -983,6 +983,7 @@ ClangImporter::create(ASTContext &ctx,
983983
if (importerOpts.Mode == ClangImporterOptions::Modes::EmbedBitcode)
984984
return importer;
985985

986+
instance.getLangOpts().NeededByPCHOrCompilationUsesPCH = true;
986987
bool canBegin = action->BeginSourceFile(instance,
987988
instance.getFrontendOpts().Inputs[0]);
988989
if (!canBegin)
@@ -1361,6 +1362,7 @@ ClangImporter::emitBridgingPCH(StringRef headerPath,
13611362
invocation->getFrontendOpts().OutputFile = outputPCHPath;
13621363
invocation->getFrontendOpts().ProgramAction = clang::frontend::GeneratePCH;
13631364
invocation->getPreprocessorOpts().resetNonModularOptions();
1365+
invocation->getLangOpts()->NeededByPCHOrCompilationUsesPCH = true;
13641366

13651367
clang::CompilerInstance emitInstance(
13661368
Impl.Instance->getPCHContainerOperations());

0 commit comments

Comments
 (0)