File tree 2 files changed +21
-0
lines changed
include/swift/RemoteInspection
stdlib/public/RemoteInspection
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,9 @@ class alignas(8) TypeRef {
210
210
// / Build a demangle tree from this TypeRef.
211
211
Demangle::NodePointer getDemangling (Demangle::Demangler &Dem) const ;
212
212
213
+ // / Build the mangled name from this TypeRef.
214
+ llvm::Optional<std::string> mangle (Demangle::Demangler &Dem) const ;
215
+
213
216
bool isConcrete () const ;
214
217
bool isConcreteAfterSubstitutions (const GenericArgumentMap &Subs) const ;
215
218
Original file line number Diff line number Diff line change @@ -1025,6 +1025,24 @@ Demangle::NodePointer TypeRef::getDemangling(Demangle::Demangler &Dem) const {
1025
1025
return DemanglingForTypeRef (Dem).visit (this );
1026
1026
}
1027
1027
1028
+ llvm::Optional<std::string> TypeRef::mangle (Demangle::Demangler &Dem) const {
1029
+ NodePointer node = getDemangling (Dem);
1030
+ if (!node)
1031
+ return {};
1032
+
1033
+ // The mangled tree stored in this typeref implicitly assumes the type and
1034
+ // global mangling, so add those back in.
1035
+ auto typeMangling = Dem.createNode (Node::Kind::TypeMangling);
1036
+ typeMangling->addChild (node, Dem);
1037
+ auto global = Dem.createNode (Node::Kind::Global);
1038
+ global->addChild (node, Dem);
1039
+
1040
+ auto mangling = mangleNode (global);
1041
+ if (!mangling.isSuccess ())
1042
+ return {};
1043
+ return mangling.result ();
1044
+ }
1045
+
1028
1046
bool TypeRef::isConcrete () const {
1029
1047
GenericArgumentMap Subs;
1030
1048
return TypeRefIsConcrete (Subs).visit (this );
You can’t perform that action at this time.
0 commit comments