@@ -65,16 +65,17 @@ SwiftMangledName SwiftMangler::visitValueDecl(const swift::ValueDecl* decl, bool
65
65
auto ret = initMangled (decl);
66
66
std::string name;
67
67
llvm::raw_string_ostream oss{name};
68
- decl->getName (). print (oss );
68
+ oss << decl->getName ();
69
69
ret << name;
70
70
if (decl->isStatic ()) {
71
71
ret << " |static" ;
72
72
}
73
73
return ret;
74
74
}
75
75
76
- SwiftMangledName SwiftMangler::visitTypeDiscriminatedValueDecl (const swift::ValueDecl* decl) {
77
- if (auto ret = visitValueDecl (decl)) {
76
+ SwiftMangledName SwiftMangler::visitTypeDiscriminatedValueDecl (const swift::ValueDecl* decl,
77
+ bool force) {
78
+ if (auto ret = visitValueDecl (decl, force)) {
78
79
ret << fetch (decl->getInterfaceType ()->getCanonicalType ());
79
80
return ret;
80
81
}
@@ -85,6 +86,13 @@ SwiftMangledName SwiftMangler::visitAbstractFunctionDecl(const swift::AbstractFu
85
86
return visitTypeDiscriminatedValueDecl (decl);
86
87
}
87
88
89
+ SwiftMangledName SwiftMangler::visitAccessorDecl (const swift::AccessorDecl* decl) {
90
+ std::string name;
91
+ llvm::raw_string_ostream oss{name};
92
+ decl->printUserFacingName (oss);
93
+ return visitTypeDiscriminatedValueDecl (decl, /* force=*/ true ) << ' _' << name;
94
+ }
95
+
88
96
SwiftMangledName SwiftMangler::visitSubscriptDecl (const swift::SubscriptDecl* decl) {
89
97
return visitTypeDiscriminatedValueDecl (decl);
90
98
}
@@ -93,6 +101,10 @@ SwiftMangledName SwiftMangler::visitVarDecl(const swift::VarDecl* decl) {
93
101
return visitTypeDiscriminatedValueDecl (decl);
94
102
}
95
103
104
+ SwiftMangledName SwiftMangler::visitParamDecl (const swift::ParamDecl* decl) {
105
+ return visitTypeDiscriminatedValueDecl (decl, /* force=*/ true );
106
+ }
107
+
96
108
SwiftMangledName SwiftMangler::visitExtensionDecl (const swift::ExtensionDecl* decl) {
97
109
if (decl->getDeclContext ()->isLocalContext ()) {
98
110
return {};
0 commit comments