[api-digester] Avoid modeling ParenType

This isn't a useful node to record.
This commit is contained in:
Hamish Knight
2024-10-07 20:07:54 +01:00
parent 512e6b3dd9
commit 289092b9ec
6 changed files with 912 additions and 2580 deletions

View File

@@ -1065,15 +1065,13 @@ static StringRef getPrintedName(SDKContext &Ctx, Type Ty,
if (IsImplicitlyUnwrappedOptional)
PO.PrintOptionalAsImplicitlyUnwrapped = true;
Ty.print(OS, PO);
Ty->getWithoutParens().print(OS, PO);
return Ctx.buffer(OS.str());
}
static StringRef getTypeName(SDKContext &Ctx, Type Ty,
bool IsImplicitlyUnwrappedOptional) {
if (Ty->getKind() == TypeKind::Paren) {
return Ctx.buffer("Paren");
}
Ty = Ty->getWithoutParens();
if (Ty->isVoid()) {
return Ctx.buffer("Void");
}
@@ -1662,12 +1660,6 @@ SwiftDeclCollector::constructTypeNode(Type T, TypeInitInfo Info) {
SDKNode* Root = SDKNodeInitInfo(Ctx, T, Info).createSDKNode(SDKNodeKind::TypeNominal);
// Keep paren type as a stand-alone level.
if (auto *PT = dyn_cast<ParenType>(T.getPointer())) {
Root->addChild(constructTypeNode(PT->getSinglyDesugaredType()));
return Root;
}
// Handle the case where Type has sub-types.
if (auto BGT = T->getAs<BoundGenericType>()) {
for (auto Arg : BGT->getGenericArgs()) {