[llvm] [BPF] Remove unused weak symbol __bpf_trap (PR #166003)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 4 10:45:01 PST 2025
================
@@ -160,6 +170,20 @@ bool BPFAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
}
void BPFAsmPrinter::emitInstruction(const MachineInstr *MI) {
+ if (MI->isCall()) {
+ for (const MachineOperand &Op : MI->operands()) {
+ if (Op.isGlobal()) {
+ if (const GlobalValue *GV = Op.getGlobal())
+ if (GV->getName() == BPF_TRAP)
+ SawTrapCall = true;
+ } else if (Op.isSymbol()) {
+ if (const MCSymbol *Sym = Op.getMCSymbol())
----------------
yonghong-song wrote:
I used Op.isSymbol() as a possible target but running bpf selftest, the branch with Op.isSymbol() never to be true, at least when running linux kernel bpf selftests.
Let me double check whether this branch isSymbol() is really necessary or not.
https://github.com/llvm/llvm-project/pull/166003
More information about the llvm-commits
mailing list