Skip to content

Commit f79eeb6

Browse files
committed
Revert "[InstrRef][NFC] Delete unused variables (llvm#75501)"
This reverts commit da2db4a.
1 parent 6f98ebf commit f79eeb6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,9 +1402,16 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
14021402
if (!MI.isDebugValue())
14031403
return false;
14041404

1405-
assert(MI.getDebugVariable()->isValidLocationForIntrinsic(MI.getDebugLoc()) &&
1405+
const DILocalVariable *Var = MI.getDebugVariable();
1406+
const DIExpression *Expr = MI.getDebugExpression();
1407+
const DILocation *DebugLoc = MI.getDebugLoc();
1408+
const DILocation *InlinedAt = DebugLoc->getInlinedAt();
1409+
assert(Var->isValidLocationForIntrinsic(DebugLoc) &&
14061410
"Expected inlined-at fields to agree");
14071411

1412+
DebugVariable V(Var, Expr, InlinedAt);
1413+
DbgValueProperties Properties(MI);
1414+
14081415
// If there are no instructions in this lexical scope, do no location tracking
14091416
// at all, this variable shouldn't get a legitimate location range.
14101417
auto *Scope = LS.findLexicalScope(MI.getDebugLoc().get());
@@ -1455,7 +1462,7 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
14551462
}
14561463
}
14571464
}
1458-
VTracker->defVar(MI, DbgValueProperties(MI), DebugOps);
1465+
VTracker->defVar(MI, Properties, DebugOps);
14591466
}
14601467

14611468
// If performing final tracking of transfers, report this variable definition

0 commit comments

Comments
 (0)