|
33 | 33 | #include "swift/SILOptimizer/Analysis/DeadEndBlocksAnalysis.h"
|
34 | 34 | #include "swift/SILOptimizer/PassManager/Transforms.h"
|
35 | 35 | #include "swift/SILOptimizer/Utils/BasicBlockOptUtils.h"
|
| 36 | +#include "swift/SILOptimizer/Utils/DebugOptUtils.h" |
36 | 37 | #include "swift/SILOptimizer/Utils/InstOptUtils.h"
|
37 | 38 | #include "swift/SILOptimizer/Utils/StackNesting.h"
|
38 | 39 | #include "llvm/ADT/MapVector.h"
|
@@ -1777,7 +1778,7 @@ static void rewriteUsesOfSscalar(StructLoweringState &pass,
|
1777 | 1778 | createOutlinedCopyCall(copyBuilder, address, dest, pass);
|
1778 | 1779 | storeUser->eraseFromParent();
|
1779 | 1780 | } else if (auto *dbgInst = dyn_cast<DebugValueInst>(user)) {
|
1780 |
| - SILBuilderWithScope dbgBuilder(dbgInst); |
| 1781 | + SILBuilder dbgBuilder(dbgInst, dbgInst->getDebugScope()); |
1781 | 1782 | // Rewrite the debug_value to point to the variable in the alloca.
|
1782 | 1783 | dbgBuilder.createDebugValueAddr(dbgInst->getLoc(), address,
|
1783 | 1784 | *dbgInst->getVarInfo());
|
@@ -2150,9 +2151,8 @@ static void rewriteFunction(StructLoweringState &pass,
|
2150 | 2151 | } else {
|
2151 | 2152 | assert(currOperand->getType().isAddress() &&
|
2152 | 2153 | "Expected an address type");
|
2153 |
| - SILBuilderWithScope debugBuilder(instr); |
2154 | 2154 | // SILBuilderWithScope skips over metainstructions.
|
2155 |
| - debugBuilder.setCurrentDebugScope(instr->getDebugScope()); |
| 2155 | + SILBuilder debugBuilder(instr, instr->getDebugScope()); |
2156 | 2156 | debugBuilder.createDebugValueAddr(instr->getLoc(), currOperand,
|
2157 | 2157 | *instr->getVarInfo());
|
2158 | 2158 | instr->getParent()->erase(instr);
|
@@ -3637,6 +3637,7 @@ class AssignAddressToDef : SILInstructionVisitor<AssignAddressToDef> {
|
3637 | 3637 |
|
3638 | 3638 | builder.createCopyAddr(load->getLoc(), load->getOperand(), addr, IsTake,
|
3639 | 3639 | IsInitialization);
|
| 3640 | + swift::salvageLoadDebugInfo(load); |
3640 | 3641 | assignment.markForDeletion(load);
|
3641 | 3642 | }
|
3642 | 3643 |
|
|
0 commit comments