Skip to content

Commit a4e71aa

Browse files
authored
Merge pull request swiftlang#36978 from apple/Demangling-Add-option-for-printing-simplified-async-resume-functions
Demangling: Add option for printing simplified async resume functions
2 parents bfa690e + 0768697 commit a4e71aa

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

include/swift/Demangling/Demangle.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct DemangleOptions {
6363
bool DisplayStdlibModule = true;
6464
bool DisplayObjCModule = true;
6565
bool PrintForTypeName = false;
66+
bool ShowAsyncResumePartial = true;
6667

6768
/// If this is nonempty, entities in this module name will not be qualified.
6869
llvm::StringRef HidingCurrentModule;

lib/Demangling/NodePrinter.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,16 +2812,20 @@ NodePointer NodePrinter::print(NodePointer Node, bool asPrefixContext) {
28122812
Printer << "async function pointer to ";
28132813
return nullptr;
28142814
case Node::Kind::AsyncAwaitResumePartialFunction:
2815-
Printer << "(";
2816-
print(Node->getChild(0));
2817-
Printer << ")";
2818-
Printer << " await resume partial function for ";
2815+
if (Options.ShowAsyncResumePartial) {
2816+
Printer << "(";
2817+
print(Node->getChild(0));
2818+
Printer << ")";
2819+
Printer << " await resume partial function for ";
2820+
}
28192821
return nullptr;
28202822
case Node::Kind::AsyncSuspendResumePartialFunction:
2821-
Printer << "(";
2822-
print(Node->getChild(0));
2823-
Printer << ")";
2824-
Printer << " suspend resume partial function for ";
2823+
if (Options.ShowAsyncResumePartial) {
2824+
Printer << "(";
2825+
print(Node->getChild(0));
2826+
Printer << ")";
2827+
Printer << " suspend resume partial function for ";
2828+
}
28252829
return nullptr;
28262830
}
28272831

0 commit comments

Comments
 (0)