@@ -8583,7 +8583,7 @@ SDDbgValue *SelectionDAG::getDbgValue(DIVariable *Var, DIExpression *Expr,
85838583 assert (cast<DILocalVariable>(Var)->isValidLocationForIntrinsic (DL ) &&
85848584 " Expected inlined-at fields to agree" );
85858585 return new (DbgInfo->getAlloc ())
8586- SDDbgValue (Var, Expr, SDDbgOperand::fromNode (N, R), {} , IsIndirect, DL , O,
8586+ SDDbgValue (Var, Expr, SDDbgOperand::fromNode (N, R), N , IsIndirect, DL , O,
85878587 /* IsVariadic=*/ false );
85888588}
85898589
@@ -8707,10 +8707,12 @@ void SelectionDAG::transferDbgValues(SDValue From, SDValue To,
87078707 Expr = *Fragment;
87088708 }
87098709
8710- auto AdditionalDependencies = Dbg->getAdditionalDependencies ();
8710+ auto NewDependencies = Dbg->copySDNodes ();
8711+ std::replace (NewDependencies.begin (), NewDependencies.end (), FromNode,
8712+ ToNode);
87118713 // Clone the SDDbgValue and move it to To.
87128714 SDDbgValue *Clone = getDbgValueList (
8713- Var, Expr, NewLocOps, AdditionalDependencies , Dbg->isIndirect (),
8715+ Var, Expr, NewLocOps, NewDependencies , Dbg->isIndirect (),
87148716 Dbg->getDebugLoc (), std::max (ToNode->getIROrder (), Dbg->getOrder ()),
87158717 Dbg->isVariadic ());
87168718 ClonedDVs.push_back (Clone);
@@ -8770,9 +8772,11 @@ void SelectionDAG::salvageDebugInfo(SDNode &N) {
87708772 (void )Changed;
87718773 assert (Changed && " Salvage target doesn't use N" );
87728774
8773- auto AdditionalDependencies = DV ->getAdditionalDependencies ();
8775+ auto NewDependencies = DV ->copySDNodes ();
8776+ std::replace (NewDependencies.begin (), NewDependencies.end (), &N,
8777+ N0 .getNode ());
87748778 SDDbgValue *Clone = getDbgValueList (DV ->getVariable (), DIExpr,
8775- NewLocOps, AdditionalDependencies ,
8779+ NewLocOps, NewDependencies ,
87768780 DV ->isIndirect (), DV ->getDebugLoc (),
87778781 DV ->getOrder (), DV ->isVariadic ());
87788782 ClonedDVs.push_back (Clone);
0 commit comments