[PATCH] D49887: [DebugInfo] Add support for DWARF5 call site-related attributes

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 21:33:51 PDT 2021


aheejin added inline comments.


================
Comment at: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:536
+      // If this is a direct call, find the callee's subprogram.
+      const MachineOperand &CalleeOp = MI.getOperand(0);
+      if (!CalleeOp.isGlobal())
----------------
djtodoro wrote:
> aheejin wrote:
> > Sorry for the late question, but is the first operand always the callee in a call instruction? That's not true for WebAssembly, but I'm wondering if WebAssembly is an exception and this holds for all other targets.
> >Sorry for the late question, but is the first operand always the callee in a call instruction?
> AFAIK, it is true for Intel, Arm, MIPS...
> 
> >That's not true for WebAssembly, but I'm wondering if WebAssembly is an exception and this holds for all other targets.
> 
> If that is the case, we can make a `TargetInstr` method, e.g. `getCallee()`, that returns the first operand in general, and override it in the WebAssembly case, right?
> 
Thanks for the reply! We have multiple call instructions and the location of the callee operand differs even among them, so we have [[ https://github.com/llvm/llvm-project/blob/ad558a4ff7cd61081cfeaabff1dbc8c0a9afa92b/llvm/lib/Target/WebAssembly/Utils/WebAssemblyUtilities.cpp#L83-L98 | getCalleeOp ]] utility method. Adding a general `getCallee` can be good, but if WebAssembly is the only target that does not satisfy the condition that the callee is the 0th operand, maybe we can add a small hacky if-else here..?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D49887/new/

https://reviews.llvm.org/D49887



More information about the llvm-commits mailing list