[SymbolGraphGen] Un-revert #78959 and clean up usage of DenseMap (#79124)

* Revert "Revert "[SymbolGraphGen] synthesize child symbols for type aliases of private…" (#79062)"

This reverts commit cac82978bc.

* clean up use of DenseMap in SymbolGraphGen

rdar://143865173
This commit is contained in:
QuietMisdreavus
2025-02-06 08:34:16 -07:00
committed by GitHub
parent 8daf94c195
commit 57450f5d18
8 changed files with 226 additions and 62 deletions

View File

@@ -37,19 +37,21 @@ using namespace swift;
using namespace symbolgraphgen;
Symbol::Symbol(SymbolGraph *Graph, const ExtensionDecl *ED,
const NominalTypeDecl *SynthesizedBaseTypeDecl, Type BaseType)
const ValueDecl *SynthesizedBaseTypeDecl, Type BaseType)
: Symbol::Symbol(Graph, nullptr, ED, SynthesizedBaseTypeDecl, BaseType) {}
Symbol::Symbol(SymbolGraph *Graph, const ValueDecl *VD,
const NominalTypeDecl *SynthesizedBaseTypeDecl, Type BaseType)
const ValueDecl *SynthesizedBaseTypeDecl, Type BaseType)
: Symbol::Symbol(Graph, VD, nullptr, SynthesizedBaseTypeDecl, BaseType) {}
Symbol::Symbol(SymbolGraph *Graph, const ValueDecl *VD, const ExtensionDecl *ED,
const NominalTypeDecl *SynthesizedBaseTypeDecl, Type BaseType)
const ValueDecl *SynthesizedBaseTypeDecl, Type BaseType)
: Graph(Graph), D(VD), BaseType(BaseType),
SynthesizedBaseTypeDecl(SynthesizedBaseTypeDecl) {
if (!BaseType && SynthesizedBaseTypeDecl)
BaseType = SynthesizedBaseTypeDecl->getDeclaredInterfaceType();
if (!BaseType && SynthesizedBaseTypeDecl) {
if (const auto *NTD = dyn_cast<NominalTypeDecl>(SynthesizedBaseTypeDecl))
BaseType = NTD->getDeclaredInterfaceType();
}
if (D == nullptr) {
D = ED;
}