[llvm] BPF: Use DebugLoc to find Filename for BTF line info (PR #90302)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 19:16:08 PDT 2024


================
@@ -1389,8 +1388,7 @@ void BTFDebug::beginInstruction(const MachineInstr *MI) {
   OS.emitLabel(LineSym);
 
   // Construct the lineinfo.
-  auto SP = DL->getScope()->getSubprogram();
-  constructLineInfo(SP, LineSym, DL.getLine(), DL.getCol());
+  constructLineInfo(LineSym, DL.get()->getFile(), DL.getLine(), DL.getCol());
----------------
eddyz87 wrote:

Nit: this could be done as follows, as `get()` is used to implement `->` operator:

```diff
-  constructLineInfo(LineSym, DL.get()->getFile(), DL.getLine(), DL.getCol());
+  constructLineInfo(LineSym, DL->getFile(), DL->getLine(), DL->getColumn());
```

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


More information about the llvm-commits mailing list