Open Geod24 opened 3 years ago
I wonder if we should mark such thunks as DIFlagArtificial
(such that LLVM treats them differently with debuginfo)...
I guess it'll always be there as long as the call isn't optimized to a tail call/jump. We only set the tail
call attribute as long as the target function isn't variadic, which apparently only affects the optimizer. While glancing over our code, it didn't seem like we set the thunk
function attribute, which might fix the musttail
issue on AArch64 (IIRC).
We only set the
tail
call attribute as long as the target function isn't variadic, which apparently only affects the optimizer.
Cannot confirm - for a simple testcase and both Windows and Linux x64 targets, without -O
, LLVM generates a jump, and the thunk isn't present in the backtraces:
interface I { void foo(); }
class C : I
{
override void foo() { throw new Exception("Oops"); }
}
void bar(I i) { i.foo(); }
void main()
{
bar(new C);
}
I've also tested adding the "thunk"
function attribute, but it's apparently ignored (i.e., not in the final IR), at least as long as the thunk is prototyped.
Just got this stack trace:
Notice the
_DThn760...
that isn't demangled. The method in question is here.