Skip to content

Commit 1c91dd4

Browse files
authored
[ParseableInterface] Include "import Swift" in swiftinterface files (#20935)
Otherwise we've got a problem with modules that use -parse-stdlib but aren't the stdlib themselves. Ideally we'd /only/ print this in that case, but we don't have that information at this point in the pipeline and I'm not sure it would be a good idea to include it in the set of options we pass through.
1 parent de835e4 commit 1c91dd4

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/Frontend/ParseableInterfaceSupport.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,7 @@ static void printImports(raw_ostream &out, ModuleDecl *M) {
528528
publicImportSet.insert(publicImports.begin(), publicImports.end());
529529

530530
for (auto import : allImports) {
531-
if (import.second->isStdlibModule() ||
532-
import.second->isOnoneSupportModule() ||
531+
if (import.second->isOnoneSupportModule() ||
533532
import.second->isBuiltinModule()) {
534533
continue;
535534
}

test/ParseableInterface/imports-submodule-order.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// CHECK-NOT: import
1818
// CHECK: import X.Submodule{{$}}
1919
// CHECK-NEXT: import Y.Submodule{{$}}
20+
// CHECK-NEXT: {{^}}import Swift{{$}}
2021
// CHECK-NEXT: import X{{$}}
2122
// CHECK-NEXT: import Y{{$}}
2223
// CHECK-NOT: import

test/ParseableInterface/imports.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ import D
1515
// CHECK-NEXT: {{^}}import B.B3{{$}}
1616
// CHECK-NEXT: {{^}}import C/*.c*/{{$}}
1717
// CHECK-NEXT: {{^}}import D{{$}}
18+
// CHECK-NEXT: {{^}}import Swift{{$}}
1819
// CHECK-NEXT: {{^}}@_exported import empty{{$}}
1920
// CHECK-NOT: import

0 commit comments

Comments
 (0)