File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ class ASTMangler : public Mangler {
169
169
return finalize ();
170
170
}
171
171
172
+ std::string mangleTypeAsUSR (Type decl);
173
+
172
174
std::string mangleTypeAsContextUSR (const NominalTypeDecl *type);
173
175
174
176
std::string mangleDeclAsUSR (const ValueDecl *Decl, StringRef USRPrefix);
Original file line number Diff line number Diff line change @@ -468,6 +468,20 @@ std::string ASTMangler::mangleTypeAsContextUSR(const NominalTypeDecl *type) {
468
468
return finalize ();
469
469
}
470
470
471
+ std::string ASTMangler::mangleTypeAsUSR (Type Ty) {
472
+ DWARFMangling = true ;
473
+ beginMangling ();
474
+
475
+ if (auto *fnType = Ty->getAs <AnyFunctionType>()) {
476
+ appendFunction (fnType, false );
477
+ } else {
478
+ appendType (Ty);
479
+ }
480
+
481
+ appendOperator (" D" );
482
+ return finalize ();
483
+ }
484
+
471
485
std::string ASTMangler::mangleDeclAsUSR (const ValueDecl *Decl,
472
486
StringRef USRPrefix) {
473
487
beginManglingWithoutPrefix ();
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ static inline StringRef getUSRSpacePrefix() {
35
35
bool ide::printTypeUSR (Type Ty, raw_ostream &OS) {
36
36
assert (!Ty->hasArchetype () && " cannot have contextless archetypes mangled." );
37
37
Mangle::ASTMangler Mangler;
38
- OS << Mangler.mangleTypeForDebugger (Ty->getRValueType (), nullptr );
38
+ OS << Mangler.mangleTypeAsUSR (Ty->getRValueType ());
39
39
return false ;
40
40
}
41
41
You can’t perform that action at this time.
0 commit comments