@@ -1675,38 +1675,35 @@ TypeSystemSwiftTypeRef::GetPointerType(opaque_compiler_type_t type) {
1675
1675
using namespace swift ::Demangle;
1676
1676
Demangler dem;
1677
1677
1678
+ // The type that will be wrapped in UnsafePointer.
1678
1679
auto *pointee_type = GetDemangledType (dem, AsMangledName (type));
1679
-
1680
+ // The UnsafePointer type.
1680
1681
auto *pointer_type = dem.createNode (Node::Kind::Type);
1681
- auto *BGS = dem.createNode (Node::Kind::BoundGenericStructure);
1682
- pointer_type->addChild (BGS, dem);
1683
-
1684
- NodePointer parent;
1685
- NodePointer child;
1686
-
1687
- // Construct the first (Type) branch of BoundGenericStructure.
1688
- parent = BGS;
1689
- child = dem.createNode (Node::Kind::Type);
1690
- parent->addChild (child, dem);
1691
- parent = child;
1692
- child = dem.createNode (Node::Kind::Structure);
1693
- parent->addChild (child, dem);
1694
- parent = child;
1695
- parent->addChild (
1696
- dem.createNodeWithAllocatedText (Node::Kind::Module, swift::STDLIB_NAME),
1697
- dem);
1698
- parent->addChild (dem.createNode (Node::Kind::Identifier, " UnsafePointer" ),
1699
- dem);
1700
-
1701
- // Construct the second (TypeList) branch of BoundGenericStructure.
1702
- parent = BGS;
1703
- child = dem.createNode (Node::Kind::TypeList);
1704
- parent->addChild (child, dem);
1705
- parent = child;
1706
- child = dem.createNode (Node::Kind::Type);
1707
- parent->addChild (child, dem);
1708
- parent = child;
1709
- parent->addChild (pointee_type, dem);
1682
+
1683
+ auto *bgs = dem.createNode (Node::Kind::BoundGenericStructure);
1684
+ pointer_type->addChild (bgs, dem);
1685
+
1686
+ // Construct the first branch of BoundGenericStructure.
1687
+ {
1688
+ auto *type = dem.createNode (Node::Kind::Type);
1689
+ bgs->addChild (type, dem);
1690
+ auto *structure = dem.createNode (Node::Kind::Structure);
1691
+ type->addChild (structure, dem);
1692
+ structure->addChild (dem.createNodeWithAllocatedText (Node::Kind::Module,
1693
+ swift::STDLIB_NAME),
1694
+ dem);
1695
+ structure->addChild (
1696
+ dem.createNode (Node::Kind::Identifier, " UnsafePointer" ), dem);
1697
+ }
1698
+
1699
+ // Construct the second branch of BoundGenericStructure.
1700
+ {
1701
+ auto *typelist = dem.createNode (Node::Kind::TypeList);
1702
+ bgs->addChild (typelist, dem);
1703
+ auto *type = dem.createNode (Node::Kind::Type);
1704
+ typelist->addChild (type, dem);
1705
+ type->addChild (pointee_type, dem);
1706
+ }
1710
1707
1711
1708
return RemangleAsType (dem, pointer_type);
1712
1709
};
0 commit comments