Skip to content

Commit 00c33f8

Browse files
authored
[Demangling] Disable ShowAsyncResumePartial in SimplifiedUI (#41870)
Change `SimplifiedUIDemangleOptions` to remove "partial function" prefixes when demangling async coroutine symbols. This removes the prefixes "await resume partial function" and "suspend resume partial function" from demangled names, in doing so hides the effect of async/coroutine function splitting from stack traces and other symbolication. This output will produce the source level function name. For example, a symbol that previously would have demangled to: ``` (1) await resume partial function for static Main.main() ``` will, with this change, demangle to: ``` static Main.main() ``` See #36978 where `ShowAsyncResumePartial` was introduced for lldb. rdar://90455541
1 parent 5e4712f commit 00c33f8

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

include/swift/Demangling/Demangle.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct DemangleOptions {
9090
Opt.ShortenArchetype = true;
9191
Opt.ShowPrivateDiscriminators = false;
9292
Opt.ShowFunctionArgumentTypes = false;
93+
Opt.ShowAsyncResumePartial = false;
9394
return Opt;
9495
};
9596
};

lib/SILOptimizer/Analysis/ClosureScope.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ void ClosureGraph::finalize() {
215215

216216
#ifndef NDEBUG
217217
static void dumpFunctionName(SILFunction *function) {
218-
llvm::dbgs() << Demangle::demangleSymbolAsString(
219-
function->getName(),
220-
Demangle::DemangleOptions::SimplifiedUIDemangleOptions())
218+
auto opts = Demangle::DemangleOptions::SimplifiedUIDemangleOptions();
219+
opts.ShowAsyncResumePartial = true;
220+
llvm::dbgs() << Demangle::demangleSymbolAsString(function->getName(), opts)
221221
<< " '" << function->getName() << "'\n";
222222
}
223223

test/Demangle/Inputs/simplified-manglings.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,5 @@ _TTSf0os___TFVs17_LegacyStringCore15_invariantCheckfT_T_ ---> specialized _Legac
211211
_TTSf2o___TTSf2s_d___TFVs17_LegacyStringCoreCfVs13_StringBufferS_ ---> specialized _LegacyStringCore.init(_:)
212212
_TTSf2do___TTSf2s_d___TFVs17_LegacyStringCoreCfVs13_StringBufferS_ ---> specialized _LegacyStringCore.init(_:)
213213
_TTSf2dos___TTSf2s_d___TFVs17_LegacyStringCoreCfVs13_StringBufferS_ ---> specialized _LegacyStringCore.init(_:)
214+
_$s4main1fSiyYaFTQ0_ ---> f()
215+
_$s4main1fSiyYaFTY0_ ---> f()

0 commit comments

Comments
 (0)