[llvm] [DebugInfo][RemoveDIs] Interpret DPValue objects in SelectionDAG (PR #72253)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 09:46:39 PST 2023
================
@@ -1250,43 +1283,31 @@ static bool handleDanglingVariadicDebugInfo(SelectionDAG &DAG,
return true;
}
-void SelectionDAGBuilder::addDanglingDebugInfo(const VarLocInfo *VarLoc,
- unsigned Order) {
- if (!handleDanglingVariadicDebugInfo(
- DAG,
- const_cast<DILocalVariable *>(DAG.getFunctionVarLocs()
- ->getVariable(VarLoc->VariableID)
- .getVariable()),
- VarLoc->DL, Order, VarLoc->Values, VarLoc->Expr)) {
- DanglingDebugInfoMap[VarLoc->Values.getVariableLocationOp(0)].emplace_back(
- VarLoc, Order);
- }
-}
-
-void SelectionDAGBuilder::addDanglingDebugInfo(const DbgValueInst *DI,
- unsigned Order) {
- // We treat variadic dbg_values differently at this stage.
- if (!handleDanglingVariadicDebugInfo(
- DAG, DI->getVariable(), DI->getDebugLoc(), Order,
- DI->getWrappedLocation(), DI->getExpression())) {
- // TODO: Dangling debug info will eventually either be resolved or produce
- // an Undef DBG_VALUE. However in the resolution case, a gap may appear
- // between the original dbg.value location and its resolved DBG_VALUE,
- // which we should ideally fill with an extra Undef DBG_VALUE.
- assert(DI->getNumVariableLocationOps() == 1 &&
- "DbgValueInst without an ArgList should have a single location "
- "operand.");
- DanglingDebugInfoMap[DI->getValue(0)].emplace_back(DI, Order);
+void SelectionDAGBuilder::addDanglingDebugInfo(SmallVectorImpl<Value *> &Values,
+ DILocalVariable *Var, DIExpression *Expr, bool IsVariadic,
+ DebugLoc DL, unsigned Order) {
+ if (IsVariadic) {
+ handleDanglingVariadicDebugInfo(
+ DAG, Var, DL, Order, Values, Expr);
+ return;
}
+ // TODO: Dangling debug info will eventually either be resolved or produce
+ // an Undef DBG_VALUE. However in the resolution case, a gap may appear
+ // between the original dbg.value location and its resolved DBG_VALUE,
+ // which we should ideally fill with an extra Undef DBG_VALUE.
+ assert(Values.size() == 1);
+ DanglingDebugInfoMap[Values[0]].emplace_back(Var, Expr, DL, Order);
+ // FIXME: In the variadic case, the variable location information is
+ // dropped.
----------------
OCHyams wrote:
I'm not sure if this is an old comment - it looks true to some definition of "dropped" but possibly should be placed/merged into `handleDanglingVariadicDebugInfo`?
https://github.com/llvm/llvm-project/pull/72253
More information about the llvm-commits
mailing list