Skip to content

Commit 5f99c31

Browse files
authored
Merge pull request #42053 from gottesmm/addr-move-function-fix-and-more-tests
[move-function] Add tests for debug info for owned arguments.
2 parents a620902 + 17cc37e commit 5f99c31

File tree

3 files changed

+362
-1
lines changed

3 files changed

+362
-1
lines changed

lib/SILOptimizer/Mandatory/MoveKillsCopyableAddressesChecker.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,9 @@ bool DataflowState::cleanupAllDestroyAddr(
15391539
// Make sure to create a new debug_value for the reinit value.
15401540
if (addressDebugInst) {
15411541
if (auto varInfo = addressDebugInst.getVarInfo()) {
1542-
SILBuilderWithScope reinitBuilder(*reinit);
1542+
// We need to always insert /after/ the reinit since the value will not
1543+
// be defined before the value.
1544+
SILBuilderWithScope reinitBuilder((*reinit)->getNextInstruction());
15431545
reinitBuilder.setCurrentDebugScope(addressDebugInst->getDebugScope());
15441546
reinitBuilder.createDebugValue(
15451547
addressDebugInst.inst->getLoc(), address, *varInfo, false,

0 commit comments

Comments
 (0)