Skip to content

Commit 98888ad

Browse files
authored
Merge pull request #24441 from eeckstein/fix-remangle-subst
2 parents 293f49e + 5daf48b commit 98888ad

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/Demangling/Remangler.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,6 +2361,9 @@ void Remangler::mangleOpaqueReturnTypeOf(Node *node) {
23612361
Buffer << "QO";
23622362
}
23632363
void Remangler::mangleOpaqueType(Node *node) {
2364+
SubstitutionEntry entry;
2365+
if (trySubstitution(node, entry)) return;
2366+
23642367
mangle(node->getChild(0));
23652368
auto boundGenerics = node->getChild(2);
23662369
for (unsigned i = 0; i < boundGenerics->getNumChildren(); ++i) {
@@ -2375,6 +2378,8 @@ void Remangler::mangleOpaqueType(Node *node) {
23752378
}
23762379
Buffer << "Qo";
23772380
mangleIndex(node->getChild(1)->getIndex());
2381+
2382+
addSubstitution(entry);
23782383
}
23792384
void Remangler::mangleAccessorFunctionReference(Node *node) {
23802385
unreachable("can't remangle");

test/Demangle/Inputs/manglings.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ _$S3BBBBf0602365061_ ---> _$S3BBBBf0602365061_
326326
_$S3BBBBi0602365061_ ---> _$S3BBBBi0602365061_
327327
_$S3BBBBv0602365061_ ---> _$S3BBBBv0602365061_
328328
_T0lxxxmmmTk ---> _T0lxxxmmmTk
329+
$s4test3fooV4blahyAA1SV1fQryFQOy_Qo_AHF ---> test.foo.blah(<<opaque return type of test.S.f() -> some>>.0) -> <<opaque return type of test.S.f() -> some>>.0
329330
$S3nix8MystructV1xACyxGx_tcfc7MyaliasL_ayx__GD ---> Myalias #1 in nix.Mystruct<A>.init(x: A) -> nix.Mystruct<A>
330331
$S3nix7MyclassCfd7MyaliasL_ayx__GD ---> Myalias #1 in nix.Myclass<A>.deinit
331332
$S3nix8MystructVyS2icig7MyaliasL_ayx__GD ---> Myalias #1 in nix.Mystruct<A>.subscript.getter : (Swift.Int) -> Swift.Int

0 commit comments

Comments
 (0)