[llvm] [BPF] Support Jump Table (PR #149715)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 23 16:57:01 PDT 2025
================
@@ -150,6 +133,115 @@ void BPFAsmPrinter::emitInstruction(const MachineInstr *MI) {
EmitToStreamer(*OutStreamer, TmpInst);
}
+MCSymbol *BPFAsmPrinter::getJTPublicSymbol(unsigned JTI) {
+ SmallString<60> Name;
+ raw_svector_ostream(Name)
+ << "BPF.JT." << MF->getFunctionNumber() << '.' << JTI;
+ MCSymbol *S = OutContext.getOrCreateSymbol(Name);
+ if (auto *ES = dyn_cast<MCSymbolELF>(S)) {
+ ES->setBinding(ELF::STB_GLOBAL);
+ ES->setType(ELF::STT_OBJECT);
+ }
+ return S;
+}
+
+MCSymbol *BPFAsmPrinter::lowerBlockAddress(const BlockAddress *BA) {
----------------
yonghong-song wrote:
Sadly you are right! I will check how to resolve this.
https://github.com/llvm/llvm-project/pull/149715
More information about the llvm-commits
mailing list