aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2024-04-23 09:31:20 +0100
committerGitHub <noreply@github.com>2024-04-23 09:31:20 +0100
commit0e44ffe817ae0f544199be70f468975fcc3ab5c5 (patch)
tree74667fc320ef4732f47c5a9d392e457cef53df28 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parent55fc5eb95fbd26ac0539089cfc4e287ad7a233c3 (diff)
downloadllvm-0e44ffe817ae0f544199be70f468975fcc3ab5c5.zip
llvm-0e44ffe817ae0f544199be70f468975fcc3ab5c5.tar.gz
llvm-0e44ffe817ae0f544199be70f468975fcc3ab5c5.tar.bz2
[DWARF] Add option to add linkage_names to call_origin declaration refs (#89640)
If -mllvm -add-linkage-names-to-external-call-origins is true then add DW_AT_linkage_name attributes to DW_TAG_subprogram DIEs referenced by DW_AT_call_origin attributes that would otherwise be omitted. A debugger may use DW_TAG_call_origin attributes to determine whether any frames in a callstack are missing due to optimisations (e.g. tail calls). For example, say a() calls b() tail-calls c(), and you stop in your debugger in c(): The callstack looks like this: c() a() Looking "up" from c(), call site information can be found in a(). This includes a DW_AT_call_origin referencing b()'s subprogram DIE, which means the call at this call site was to b(), not c() where we are currently stopped. This indicates b()'s frame has been lost due to optimisation (or is misleading due to ICF). This patch makes it easier for a debugger to check whether the referenced DIE describes the target function or not, for example by comparing the referenced function name to the current frame. There's already an option to apply DW_AT_linkage_name in a targeted manner: -dwarf-linkage-names=Abstract, which limits adding DW_AT_linkage_names to abstract subprogram DIEs (this is default for SCE tuning). The new flag shouldn't affect non-SCE-tuned behaviour whether it is enabled or not because the non-SCE-tuned behaviour is to always add linkage names to subprogram DIEs.
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
0 files changed, 0 insertions, 0 deletions