rename symbol graph files for cross-import overlays

rdar://79474927
This commit is contained in:
Victoria Mitchell
2021-06-22 16:50:34 -06:00
parent 29176fc32a
commit 183db81d12
4 changed files with 43 additions and 24 deletions

View File

@@ -45,6 +45,11 @@ SymbolGraph *SymbolGraphASTWalker::getModuleSymbolGraph(const Decl *D) {
if (this->M.getNameStr().equals(M->getNameStr())) {
return &MainGraph;
} else if (MainGraph.DeclaringModule.hasValue() &&
MainGraph.DeclaringModule.getValue()->getNameStr().equals(M->getNameStr())) {
// Cross-import overlay modules already appear as "extensions" of their declaring module; we
// should put actual extensions of that module into the main graph
return &MainGraph;
}
auto Found = ExtendedModuleGraphs.find(M->getNameStr());
if (Found != ExtendedModuleGraphs.end()) {