Skip to content

Commit ac5b615

Browse files
[BPF] Remove dead code related to __bpf_trap global var (#166440)
In [1], the symbol __bpf_trap (macro BPF_TRAP) is removed if it is not used in the code. In the discussion in [1], it is found that the branch "if (Op.isSymbol())" is actually always false. Remove it to avoid confusion. [1] #166003
1 parent a51d219 commit ac5b615

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

llvm/lib/Target/BPF/BPFAsmPrinter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ void BPFAsmPrinter::emitInstruction(const MachineInstr *MI) {
176176
if (const GlobalValue *GV = Op.getGlobal())
177177
if (GV->getName() == BPF_TRAP)
178178
SawTrapCall = true;
179-
} else if (Op.isSymbol()) {
180-
if (const MCSymbol *Sym = Op.getMCSymbol())
181-
if (Sym->getName() == BPF_TRAP)
182-
SawTrapCall = true;
183179
}
184180
}
185181
}

0 commit comments

Comments
 (0)