[llvm] [BPF] Support Jump Table (PR #149715)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 20 08:48:12 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/lib/Target/BPF/BPFAsmPrinter.h llvm/lib/Target/BPF/BPFTargetLoweringObjectFile.cpp llvm/lib/Target/BPF/BPFTargetLoweringObjectFile.h llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp llvm/lib/Target/BPF/BPFAsmPrinter.cpp llvm/lib/Target/BPF/BPFISelLowering.cpp llvm/lib/Target/BPF/BPFISelLowering.h llvm/lib/Target/BPF/BPFInstrInfo.cpp llvm/lib/Target/BPF/BPFInstrInfo.h llvm/lib/Target/BPF/BPFMCInstLower.cpp llvm/lib/Target/BPF/BPFMCInstLower.h llvm/lib/Target/BPF/BPFMIPeephole.cpp llvm/lib/Target/BPF/BPFTargetMachine.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/BPF/BPFMCInstLower.cpp b/llvm/lib/Target/BPF/BPFMCInstLower.cpp
index ec6ba6029..295c27bd1 100644
--- a/llvm/lib/Target/BPF/BPFMCInstLower.cpp
+++ b/llvm/lib/Target/BPF/BPFMCInstLower.cpp
@@ -84,7 +84,8 @@ void BPFMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
MCOp = LowerSymbolOperand(MO, Printer.getJTPublicSymbol(MO.getIndex()));
break;
case MachineOperand::MO_BlockAddress:
- MCOp = LowerSymbolOperand(MO, Printer.GetBlockAddressSymbol(MO.getBlockAddress()));
+ MCOp = LowerSymbolOperand(
+ MO, Printer.GetBlockAddressSymbol(MO.getBlockAddress()));
break;
}
diff --git a/llvm/lib/Target/BPF/BPFMIPeephole.cpp b/llvm/lib/Target/BPF/BPFMIPeephole.cpp
index 0d31e4529..9d3d78831 100644
--- a/llvm/lib/Target/BPF/BPFMIPeephole.cpp
+++ b/llvm/lib/Target/BPF/BPFMIPeephole.cpp
@@ -764,7 +764,7 @@ bool BPFMIPreEmitPeephole::convertPrivateGlobal() {
// @__const.foo.jt1 = private unnamed_addr constant [2 x ptr]
// [ptr blockaddress(@foo, %l1), ptr blockaddress(@foo, %l2)], align 8
Module *M = MF->getFunction().getParent();
- for (GlobalVariable &Global: M->globals()) {
+ for (GlobalVariable &Global : M->globals()) {
if (Global.getLinkage() != GlobalValue::PrivateLinkage)
continue;
if (!Global.isConstant())
``````````
</details>
https://github.com/llvm/llvm-project/pull/149715
More information about the llvm-commits
mailing list