@@ -385,7 +385,7 @@ struct StructLoweringState {
385
385
SmallVector<SILInstruction *, 16 > destroyValueInstsToMod;
386
386
// All debug instructions.
387
387
// to be modified *only if* the operands are used in "real" instructions
388
- SmallVector<SILInstruction *, 16 > debugInstsToMod;
388
+ SmallVector<DebugValueInst *, 16 > debugInstsToMod;
389
389
390
390
StructLoweringState (SILFunction *F, irgen::IRGenModule &Mod)
391
391
: F(F), Mod(Mod) {}
@@ -1860,7 +1860,7 @@ static void rewriteFunction(StructLoweringState &pass,
1860
1860
instr->getParent ()->erase (instr);
1861
1861
}
1862
1862
1863
- for (SILInstruction *instr : pass.debugInstsToMod ) {
1863
+ for (DebugValueInst *instr : pass.debugInstsToMod ) {
1864
1864
assert (instr->getAllOperands ().size () == 1 &&
1865
1865
" Debug instructions have one operand" );
1866
1866
for (Operand &operand : instr->getAllOperands ()) {
@@ -1875,7 +1875,8 @@ static void rewriteFunction(StructLoweringState &pass,
1875
1875
assert (currOperand->getType ().isAddress () &&
1876
1876
" Expected an address type" );
1877
1877
SILBuilderWithScope debugBuilder (instr);
1878
- debugBuilder.createDebugValueAddr (instr->getLoc (), currOperand);
1878
+ debugBuilder.createDebugValueAddr (instr->getLoc (), currOperand,
1879
+ instr->getVarInfo ());
1879
1880
instr->getParent ()->erase (instr);
1880
1881
}
1881
1882
}
0 commit comments