@@ -65,16 +65,17 @@ SwiftMangledName SwiftMangler::visitValueDecl(const swift::ValueDecl* decl, bool
6565 auto ret = initMangled (decl);
6666 std::string name;
6767 llvm::raw_string_ostream oss{name};
68- decl->getName (). print (oss );
68+ oss << decl->getName ();
6969 ret << name;
7070 if (decl->isStatic ()) {
7171 ret << " |static" ;
7272 }
7373 return ret;
7474}
7575
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)) {
7879 ret << fetch (decl->getInterfaceType ()->getCanonicalType ());
7980 return ret;
8081 }
@@ -85,6 +86,13 @@ SwiftMangledName SwiftMangler::visitAbstractFunctionDecl(const swift::AbstractFu
8586 return visitTypeDiscriminatedValueDecl (decl);
8687}
8788
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+
8896SwiftMangledName SwiftMangler::visitSubscriptDecl (const swift::SubscriptDecl* decl) {
8997 return visitTypeDiscriminatedValueDecl (decl);
9098}
@@ -93,6 +101,10 @@ SwiftMangledName SwiftMangler::visitVarDecl(const swift::VarDecl* decl) {
93101 return visitTypeDiscriminatedValueDecl (decl);
94102}
95103
104+ SwiftMangledName SwiftMangler::visitParamDecl (const swift::ParamDecl* decl) {
105+ return visitTypeDiscriminatedValueDecl (decl, /* force=*/ true );
106+ }
107+
96108SwiftMangledName SwiftMangler::visitExtensionDecl (const swift::ExtensionDecl* decl) {
97109 if (decl->getDeclContext ()->isLocalContext ()) {
98110 return {};
0 commit comments