Skip to content

Commit 13c17ae

Browse files
committed
[Concurrency] Only auto-import _Concurrency when auto-importing Swift.
This allows the standard library to build with concurrency enabled. Fixes rdar://70700689.
1 parent 096828e commit 13c17ae

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/Frontend/Frontend.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,15 @@ ImplicitImportInfo CompilerInstance::getImplicitImportInfo() const {
763763
}
764764

765765
if (Invocation.shouldImportSwiftConcurrency()) {
766-
pushImport(SWIFT_CONCURRENCY_NAME);
766+
switch (imports.StdlibKind) {
767+
case ImplicitStdlibKind::Builtin:
768+
case ImplicitStdlibKind::None:
769+
break;
770+
771+
case ImplicitStdlibKind::Stdlib:
772+
pushImport(SWIFT_CONCURRENCY_NAME);
773+
break;
774+
}
767775
}
768776

769777
imports.ShouldImportUnderlyingModule = frontendOpts.ImportUnderlyingModule;

0 commit comments

Comments
 (0)