[llvm] [DebugInfo][DWARF] Add heapallocsite information (PR #132073)
Jann Horn via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 6 07:48:41 PDT 2025
thejh wrote:
I have now rebased the patch; sorry, it changed a little bit since I merge-conflicted with myself. The interdiff between the old and new version is:
```diff
@@ llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp: DIE &DwarfCompileUnit::constru
getDwarf5OrGNUAttr(dwarf::DW_AT_call_return_pc), PCAddr);
}
-+ if (AllocSiteTy) {
++ if (AllocSiteTy)
+ addType(CallSiteDIE, AllocSiteTy, dwarf::DW_AT_LLVM_alloc_type);
-+ }
+
return CallSiteDIE;
}
@@ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp: void DwarfDebug::constructCallSiteEn
// If this is a direct call, find the callee's subprogram.
// In the case of an indirect call find the register that holds
// the callee.
- const MachineOperand &CalleeOp = TII->getCalleeOperand(MI);
-- if (!CalleeOp.isGlobal() &&
-- (!CalleeOp.isReg() || !CalleeOp.getReg().isPhysical()))
+@@ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp: void DwarfDebug::constructCallSiteEntryDIEs(const DISubprogram &SP,
+ PhysRegCalleeOperand =
+ PhysRegCalleeOperand && MCOI.OperandType == MCOI::OPERAND_REGISTER;
+ }
+- if (!CalleeOp.isGlobal() && !PhysRegCalleeOperand)
- continue;
unsigned CallReg = 0;
const DISubprogram *CalleeSP = nullptr;
const Function *CalleeDecl = nullptr;
-- if (CalleeOp.isReg()) {
+ if (PhysRegCalleeOperand) {
- CallReg = CalleeOp.getReg();
- if (!CallReg)
- continue;
- } else {
-+ if (CalleeOp.isReg() && CalleeOp.getReg().isPhysical()) {
+ CallReg = CalleeOp.getReg(); // might be zero
+ } else if (CalleeOp.isGlobal()) {
CalleeDecl = dyn_cast<Function>(CalleeOp.getGlobal());
```
https://github.com/llvm/llvm-project/pull/132073
More information about the llvm-commits
mailing list