@@ -375,7 +375,7 @@ struct StructLoweringState {
375
375
SmallVector<SILInstruction *, 16 > destroyValueInstsToMod;
376
376
// All debug instructions.
377
377
// to be modified *only if* the operands are used in "real" instructions
378
- SmallVector<SILInstruction *, 16 > debugInstsToMod;
378
+ SmallVector<DebugValueInst *, 16 > debugInstsToMod;
379
379
380
380
StructLoweringState (SILFunction *F, irgen::IRGenModule &Mod)
381
381
: F(F), Mod(Mod) {}
@@ -1780,7 +1780,7 @@ static void rewriteFunction(StructLoweringState &pass,
1780
1780
instr->getParent ()->erase (instr);
1781
1781
}
1782
1782
1783
- for (SILInstruction *instr : pass.debugInstsToMod ) {
1783
+ for (DebugValueInst *instr : pass.debugInstsToMod ) {
1784
1784
assert (instr->getAllOperands ().size () == 1 &&
1785
1785
" Debug instructions have one operand" );
1786
1786
for (Operand &operand : instr->getAllOperands ()) {
@@ -1795,7 +1795,8 @@ static void rewriteFunction(StructLoweringState &pass,
1795
1795
assert (currOperand->getType ().isAddress () &&
1796
1796
" Expected an address type" );
1797
1797
SILBuilderWithScope debugBuilder (instr);
1798
- debugBuilder.createDebugValueAddr (instr->getLoc (), currOperand);
1798
+ debugBuilder.createDebugValueAddr (instr->getLoc (), currOperand,
1799
+ instr->getVarInfo ());
1799
1800
instr->getParent ()->erase (instr);
1800
1801
}
1801
1802
}
0 commit comments