Skip to content

Commit bf9274d

Browse files
add the overlay module name to the overlay symbol graph file name
1 parent 5bf567f commit bf9274d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/SymbolGraphGen/SymbolGraphGen.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@ int serializeSymbolGraph(SymbolGraph &SG,
2424
const SymbolGraphOptions &Options) {
2525
SmallString<256> FileName;
2626
if (SG.DeclaringModule.hasValue()) {
27-
// Save a cross-import overlay symbol graph as `MainModule@BystandingModule[@BystandingModule...].symbols.json`
27+
// Save a cross-import overlay symbol graph as `MainModule@BystandingModule[@BystandingModule...]@OverlayModule.symbols.json`
28+
//
29+
// The overlay module's name is added as a disambiguator in case an overlay
30+
// declares multiple modules for the same set of imports.
2831
FileName.append(SG.DeclaringModule.getValue()->getNameStr());
2932
for (auto BystanderModule : SG.BystanderModules) {
3033
FileName.push_back('@');
3134
FileName.append(BystanderModule.str());
3235
}
36+
37+
FileName.push_back('@');
38+
FileName.append(SG.M.getNameStr());
3339
} else {
3440
FileName.append(SG.M.getNameStr());
3541

test/SymbolGraph/Module/CrossImport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-build-swift %s -module-name _A_B -I %t -emit-module -emit-module-path %t/
55
// RUN: cp -r %S/Inputs/CrossImport/A.swiftcrossimport %t/
66
// RUN: %target-swift-symbolgraph-extract -module-name A -I %t -pretty-print -output-dir %t
7-
// RUN: %FileCheck %s --input-file %t/[email protected]
7+
// RUN: %FileCheck %s --input-file %t/A@B@_A_B.symbols.json
88

99
@_exported import A
1010
import B

0 commit comments

Comments
 (0)