[llvm] [BPF] Handle unreachable with a kfunc call (PR #131731)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 18:25:44 PDT 2025


================
@@ -1622,6 +1627,25 @@ void BTFDebug::endModule() {
   // Collect global types/variables except MapDef globals.
   processGlobals(false);
 
+  // Create a BTF entry for func BPF_UNREACHABLE.
----------------
eddyz87 wrote:

Special cases added in `BTFDebug.cpp` can be avoided with the attached patch:
[bpf-unreachable.patch.txt](https://github.com/user-attachments/files/20378501/bpf-unreachable.patch.txt)
The idea is to generate proper DISubprogram for the `bpf_unreachable` as for kfunc, so that BTFDebug logic works as-is.

https://github.com/llvm/llvm-project/pull/131731


More information about the llvm-commits mailing list