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