Skip to content

Commit f9951b3

Browse files
authored
Merge pull request #32507 from nkcsgexi/swift-name-convention
ExplicitModules: use key names conforming to Swift naming convention in explicit Swift module maps. NFC
2 parents 451fd09 + 05de54f commit f9951b3

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,13 +1460,13 @@ struct ExplicitSwiftModuleLoader::Implementation {
14601460
for (auto &entry: *mapNode) {
14611461
auto key = getScalaNodeText(entry.getKey());
14621462
auto val = getScalaNodeText(entry.getValue());
1463-
if (key == "SwiftModule") {
1463+
if (key == "moduleName") {
14641464
moduleName = val;
1465-
} else if (key == "SwiftModulePath") {
1465+
} else if (key == "modulePath") {
14661466
result.modulePath = val;
1467-
} else if (key == "SwiftDocPath") {
1467+
} else if (key == "docPath") {
14681468
result.moduleDocPath = val;
1469-
} else if (key == "SwiftSourceInfoPath") {
1469+
} else if (key == "sourceInfoPath") {
14701470
result.moduleSourceInfoPath = val;
14711471
} else {
14721472
// Being forgiving for future fields.
@@ -1480,16 +1480,16 @@ struct ExplicitSwiftModuleLoader::Implementation {
14801480
}
14811481
// [
14821482
// {
1483-
// "SwiftModule": "A",
1484-
// "SwiftModulePath": "A.swiftmodule",
1485-
// "SwiftDocPath": "A.swiftdoc",
1486-
// "SwiftSourceInfoPath": "A.swiftsourceinfo"
1483+
// "moduleName": "A",
1484+
// "modulePath": "A.swiftmodule",
1485+
// "docPath": "A.swiftdoc",
1486+
// "sourceInfoPath": "A.swiftsourceinfo"
14871487
// },
14881488
// {
1489-
// "SwiftModule": "B",
1490-
// "SwiftModulePath": "B.swiftmodule",
1491-
// "SwiftDocPath": "B.swiftdoc",
1492-
// "SwiftSourceInfoPath": "B.swiftsourceinfo"
1489+
// "moduleName": "B",
1490+
// "modulePath": "B.swiftmodule",
1491+
// "docPath": "B.swiftdoc",
1492+
// "sourceInfoPath": "B.swiftsourceinfo"
14931493
// }
14941494
// ]
14951495
void parseSwiftExplicitModuleMap(StringRef fileName) {

test/ScanDependencies/explicit-module-map.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/inputs/Foo.swiftmodule -emit-module-doc-path %t/inputs/Foo.swiftdoc -emit-module-source-info -emit-module-source-info-path %t/inputs/Foo.swiftsourceinfo -module-cache-path %t.module-cache %t/foo.swift -module-name Foo
77

88
// RUN: echo "[{" > %/t/inputs/map.json
9-
// RUN: echo "\"SwiftModule\": \"Foo\"," >> %/t/inputs/map.json
10-
// RUN: echo "\"SwiftModulePath\": \"%/t/inputs/Foo.swiftmodule\"," >> %/t/inputs/map.json
11-
// RUN: echo "\"SwiftDocPath\": \"%/t/inputs/Foo.swiftdoc\"," >> %/t/inputs/map.json
12-
// RUN: echo "\"SwiftSourceInfoPath\": \"%/t/inputs/Foo.swiftsourceinfo\"" >> %/t/inputs/map.json
9+
// RUN: echo "\"moduleName\": \"Foo\"," >> %/t/inputs/map.json
10+
// RUN: echo "\"modulePath\": \"%/t/inputs/Foo.swiftmodule\"," >> %/t/inputs/map.json
11+
// RUN: echo "\"docPath\": \"%/t/inputs/Foo.swiftdoc\"," >> %/t/inputs/map.json
12+
// RUN: echo "\"sourceInfoPath\": \"%/t/inputs/Foo.swiftsourceinfo\"" >> %/t/inputs/map.json
1313
// RUN: echo "}]" >> %/t/inputs/map.json
1414

1515
// RUN: %target-swift-ide-test -print-module-comments -module-to-print=Foo -enable-swiftsourceinfo -source-filename %s -explicit-swift-module-map-file %t/inputs/map.json | %FileCheck %s

0 commit comments

Comments
 (0)