mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[api-digester] Avoid modeling ParenType
This isn't a useful node to record.
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user