@@ -1495,19 +1495,6 @@ static bool valueCoversEntireFragment(Type *ValTy, DbgVariableIntrinsic *DII) {
1495
1495
return false ;
1496
1496
}
1497
1497
1498
- // / Produce a DebugLoc to use for each dbg.declare/inst pair that are promoted
1499
- // / to a dbg.value. Because no machine insts can come from debug intrinsics,
1500
- // / only the scope and inlinedAt is significant. Zero line numbers are used in
1501
- // / case this DebugLoc leaks into any adjacent instructions.
1502
- static DebugLoc getDebugValueLoc (DbgVariableIntrinsic *DII, Instruction *Src) {
1503
- // Original dbg.declare must have a location.
1504
- const DebugLoc &DeclareLoc = DII->getDebugLoc ();
1505
- MDNode *Scope = DeclareLoc.getScope ();
1506
- DILocation *InlinedAt = DeclareLoc.getInlinedAt ();
1507
- // Produce an unknown location with the correct scope / inlinedAt fields.
1508
- return DILocation::get (DII->getContext (), 0 , 0 , Scope, InlinedAt);
1509
- }
1510
-
1511
1498
// / Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
1512
1499
// / that has an associated llvm.dbg.declare or llvm.dbg.addr intrinsic.
1513
1500
void llvm::ConvertDebugDeclareToDebugValue (DbgVariableIntrinsic *DII,
@@ -1518,7 +1505,7 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
1518
1505
auto *DIExpr = DII->getExpression ();
1519
1506
Value *DV = SI->getValueOperand ();
1520
1507
1521
- DebugLoc NewLoc = getDebugValueLoc (DII, SI );
1508
+ DebugLoc NewLoc = getDebugValueLoc (DII);
1522
1509
1523
1510
if (!valueCoversEntireFragment (DV->getType (), DII)) {
1524
1511
// FIXME: If storing to a part of the variable described by the dbg.declare,
@@ -1553,7 +1540,7 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
1553
1540
return ;
1554
1541
}
1555
1542
1556
- DebugLoc NewLoc = getDebugValueLoc (DII, nullptr );
1543
+ DebugLoc NewLoc = getDebugValueLoc (DII);
1557
1544
1558
1545
// We are now tracking the loaded value instead of the address. In the
1559
1546
// future if multi-location support is added to the IR, it might be
@@ -1587,7 +1574,7 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
1587
1574
BasicBlock *BB = APN->getParent ();
1588
1575
auto InsertionPt = BB->getFirstInsertionPt ();
1589
1576
1590
- DebugLoc NewLoc = getDebugValueLoc (DII, nullptr );
1577
+ DebugLoc NewLoc = getDebugValueLoc (DII);
1591
1578
1592
1579
// The block may be a catchswitch block, which does not have a valid
1593
1580
// insertion point.
@@ -1659,7 +1646,7 @@ bool llvm::LowerDbgDeclare(Function &F) {
1659
1646
// pointer to the variable. Insert a *value* intrinsic that describes
1660
1647
// the variable by dereferencing the alloca.
1661
1648
if (!CI->isLifetimeStartOrEnd ()) {
1662
- DebugLoc NewLoc = getDebugValueLoc (DDI, nullptr );
1649
+ DebugLoc NewLoc = getDebugValueLoc (DDI);
1663
1650
auto *DerefExpr =
1664
1651
DIExpression::append (DDI->getExpression (), dwarf::DW_OP_deref);
1665
1652
DIB.insertDbgValueIntrinsic (AI, DDI->getVariable (), DerefExpr,
0 commit comments