aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorDaniel Paoliello <danpao@microsoft.com>2023-08-25 09:59:22 -0700
committerDaniel Paoliello <danpao@microsoft.com>2023-08-25 10:19:17 -0700
commit8d0c3db388143f4e058b5f513a70fd5d089d51c3 (patch)
treeef921d024f8e819a23a2c1b91b69c5275493c9c7 /llvm/lib/CodeGen/MachineCSE.cpp
parent5adac8bebcf26841c1d87227c5043af83a9ef94b (diff)
downloadllvm-8d0c3db388143f4e058b5f513a70fd5d089d51c3.zip
llvm-8d0c3db388143f4e058b5f513a70fd5d089d51c3.tar.gz
llvm-8d0c3db388143f4e058b5f513a70fd5d089d51c3.tar.bz2
Emit the CodeView `S_ARMSWITCHTABLE` debug symbol for jump tables
The CodeView `S_ARMSWITCHTABLE` debug symbol is used to describe the layout of a jump table, it contains the following information: * The address of the branch instruction that uses the jump table. * The address of the jump table. * The "base" address that the values in the jump table are relative to. * The type of each entry (absolute pointer, a relative integer, a relative integer that is shifted). Together this information can be used by debuggers and binary analysis tools to understand what an jump table indirect branch is doing and where it might jump to. Documentation for the symbol can be found in the Microsoft PDB library dumper: https://github.com/microsoft/microsoft-pdb/blob/0fe89a942f9a0f8e061213313e438884f4c9b876/cvdump/dumpsym7.cpp#L5518 This change adds support to LLVM to emit the `S_ARMSWITCHTABLE` debug symbol as well as to dump it out (for testing purposes). Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D149367
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index 8bd7eae..89c4562 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -407,7 +407,7 @@ bool MachineCSE::PhysRegDefsReach(MachineInstr *CSMI, MachineInstr *MI,
bool MachineCSE::isCSECandidate(MachineInstr *MI) {
if (MI->isPosition() || MI->isPHI() || MI->isImplicitDef() || MI->isKill() ||
- MI->isInlineAsm() || MI->isDebugInstr())
+ MI->isInlineAsm() || MI->isDebugInstr() || MI->isJumpTableDebugInfo())
return false;
// Ignore copies.