File tree 4 files changed +14
-1
lines changed
4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,12 @@ class Demangler : public NodeFactory {
328
328
Pos--;
329
329
}
330
330
331
+ StringRef consumeAll () {
332
+ StringRef str = Text.drop_front (Pos);
333
+ Pos = Text.size ();
334
+ return str;
335
+ }
336
+
331
337
void pushNode (NodePointer Nd) {
332
338
NodeStack.push_back (Nd, *this );
333
339
}
Original file line number Diff line number Diff line change @@ -418,6 +418,11 @@ NodePointer Demangler::demangleOperator() {
418
418
case ' z' : return createType (createWithChild (Node::Kind::InOut,
419
419
popTypeAndGetChild ()));
420
420
case ' _' : return createNode (Node::Kind::FirstElementMarker);
421
+ case ' .' :
422
+ // IRGen still uses '.<n>' to disambiguate partial apply thunks and
423
+ // outlined copy functions. We treat such a suffix as "unmangled suffix".
424
+ pushBack ();
425
+ return createNode (Node::Kind::Suffix, consumeAll ());
421
426
default :
422
427
pushBack ();
423
428
return demangleIdentifier ();
Original file line number Diff line number Diff line change @@ -264,3 +264,5 @@ _T0A8 ---> _T0A8
264
264
_T0s30ReversedRandomAccessCollectionVyxGTfq3nnpf_nTfq1cn_nTfq4x_n ---> _T0s30ReversedRandomAccessCollectionVyxGTfq3nnpf_nTfq1cn_nTfq4x_n
265
265
_T03abc6testitySiFTm ---> merged abc.testit(Swift.Int) -> ()
266
266
_T04main4TestCACSi1x_tc6_PRIV_Llfc ---> main.Test.(in _PRIV_).init(x: Swift.Int) -> main.Test
267
+ _T0SqWy.17 ---> outlined copy of Swift.Optional with unmangled suffix ".17"
268
+
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ static int demangleSTDIN(const swift::Demangle::DemangleOptions &options) {
166
166
// This doesn't handle Unicode symbols, but maybe that's okay.
167
167
// Also accept the future mangling prefix.
168
168
// TODO: remove the "_S" as soon as MANGLING_PREFIX_STR gets "_S".
169
- llvm::Regex maybeSymbol (" (_T|_*\\ $S|" MANGLING_PREFIX_STR " )[_a-zA-Z0-9$]+" );
169
+ llvm::Regex maybeSymbol (" (_T|_*\\ $S|" MANGLING_PREFIX_STR " )[_a-zA-Z0-9$. ]+" );
170
170
171
171
swift::Demangle::Context DCtx;
172
172
for (std::string mangled; std::getline (std::cin, mangled);) {
You can’t perform that action at this time.
0 commit comments