Skip to content

Commit 3ab320b

Browse files
authored
Merge pull request #69469 from artemcm/FixCrossImportOverlayTypo
[Dependency Scan] On cross-import overlay discovery, do not exit on main module...
2 parents d69fd57 + abec212 commit 3ab320b

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

lib/DependencyScan/ModuleDependencyScanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ void ModuleDependencyScanner::discoverCrossImportOverlayDependencies(
800800
auto moduleName = dependencyId.ModuleName;
801801
// Do not look for overlays of main module under scan
802802
if (moduleName == mainModuleName)
803-
return;
803+
continue;
804804
// check if any explicitly imported modules can serve as a
805805
// secondary module, and add the overlay names to the
806806
// dependencies list.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void funcCIM(void);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
module SubE {
22
header "SubE.h"
33
export *
4+
}
5+
module CrossImportTestModule {
6+
header "CrossImportTestModule.h"
7+
export *
48
}

test/ScanDependencies/module_deps_cross_import_overlay.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
// RUN: %empty-directory(%t)
22
// RUN: mkdir -p %t/clang-module-cache
3-
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -emit-dependencies -emit-dependencies-path %t/deps.d -import-objc-header %S/Inputs/CHeaders/Bridging.h -swift-version 4
3+
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -I %S/Inputs/CHeaders/ExtraCModules -emit-dependencies -emit-dependencies-path %t/deps.d -import-objc-header %S/Inputs/CHeaders/Bridging.h -swift-version 4 -module-name CrossImportTestModule
44
// Check the contents of the JSON output
55
// RUN: %validate-json %t/deps.json | %FileCheck %s
66

77
// Ensure that round-trip serialization does not affect result
8-
// RUN: %target-swift-frontend -scan-dependencies -test-dependency-scan-cache-serialization -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -emit-dependencies -emit-dependencies-path %t/deps.d -import-objc-header %S/Inputs/CHeaders/Bridging.h -swift-version 4
8+
// RUN: %target-swift-frontend -scan-dependencies -test-dependency-scan-cache-serialization -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -I %S/Inputs/CHeaders/ExtraCModules -emit-dependencies -emit-dependencies-path %t/deps.d -import-objc-header %S/Inputs/CHeaders/Bridging.h -swift-version 4 -module-name CrossImportTestModule
99
// RUN: %validate-json %t/deps.json | %FileCheck %s
1010

1111
// REQUIRES: executable_test
1212
// REQUIRES: objc_interop
1313

14+
import CrossImportTestModule
1415
import EWrapper
1516
import SubEWrapper
1617

@@ -24,6 +25,7 @@ import SubEWrapper
2425
// CHECK-DAG: "swift": "_StringProcessing"
2526
// CHECK-DAG: "swift": "_cross_import_E"
2627
// CHECK-DAG: "clang": "_SwiftConcurrencyShims"
28+
// CHECK-DAG: "clang": "CrossImportTestModule"
2729
// Ensure a transitive dependency via "_cross_import_E" is not a direct dep of main module
2830
// CHECK-NOT: "clang": "X"
2931
// CHECK: ],

0 commit comments

Comments
 (0)