mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
rename symbol graph files for cross-import overlays
rdar://79474927
This commit is contained in:
@@ -25,26 +25,14 @@ namespace {
|
||||
int serializeSymbolGraph(SymbolGraph &SG,
|
||||
const SymbolGraphOptions &Options) {
|
||||
SmallString<256> FileName;
|
||||
if (SG.DeclaringModule.hasValue()) {
|
||||
// Save a cross-import overlay symbol graph as `MainModule@BystandingModule[@BystandingModule...]@OverlayModule.symbols.json`
|
||||
//
|
||||
// The overlay module's name is added as a disambiguator in case an overlay
|
||||
// declares multiple modules for the same set of imports.
|
||||
FileName.append(SG.DeclaringModule.getValue()->getNameStr());
|
||||
for (auto BystanderModule : SG.BystanderModules) {
|
||||
FileName.push_back('@');
|
||||
FileName.append(BystanderModule.str());
|
||||
}
|
||||
|
||||
FileName.append(SG.M.getNameStr());
|
||||
if (SG.ExtendedModule.hasValue()) {
|
||||
FileName.push_back('@');
|
||||
FileName.append(SG.M.getNameStr());
|
||||
} else {
|
||||
FileName.append(SG.M.getNameStr());
|
||||
|
||||
if (SG.ExtendedModule.hasValue()) {
|
||||
FileName.push_back('@');
|
||||
FileName.append(SG.ExtendedModule.getValue()->getNameStr());
|
||||
}
|
||||
FileName.append(SG.ExtendedModule.getValue()->getNameStr());
|
||||
} else if (SG.DeclaringModule.hasValue()) {
|
||||
// Treat cross-import overlay modules as "extensions" of their declaring module
|
||||
FileName.push_back('@');
|
||||
FileName.append(SG.DeclaringModule.getValue()->getNameStr());
|
||||
}
|
||||
FileName.append(".symbols.json");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user