Skip to content

Commit 96140dd

Browse files
committed
[move-only] Rather than calling the borrow to destructure transform from the MoveOnlyObjectChecker, make its own pass.
This is a cleaner separation of concerns. The reason why I did not do this originally is that I thought I would need to reuse this functionality in the address checker, but this issue actually does not come up there since we project the address and then load instead of load and then project.
1 parent 8738c81 commit 96140dd

File tree

6 files changed

+1319
-1431
lines changed

6 files changed

+1319
-1431
lines changed

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,12 @@ PASS(MovedAsyncVarDebugInfoPropagator, "sil-moved-async-var-dbginfo-propagator",
460460
"Propagate debug info from moved async vars after coroutine funclet boundaries")
461461
PASS(MoveOnlyDeinitInsertion, "sil-move-only-deinit-insertion",
462462
"After running move only checking, convert last destroy_values to deinit calls")
463-
PASS(MoveOnlyBorrowToDestructureTransform, "sil-move-only-borrow-to-destructure",
464-
"Utility pass that is used to test the borrow to destructure transform "
465-
"independently of the move only object/address checkers")
463+
PASS(MoveOnlyBorrowToDestructureTransform,
464+
"sil-move-only-borrow-to-destructure",
465+
"Pass that is phased ordered before move only object checking that is "
466+
"used to convert borrow+projection to destructures. Once this has run, the move "
467+
"only object checker runs and ensures that the destructures do not create "
468+
"any move only errors with respect to non-borrow+projection uses")
466469
PASS(PruneVTables, "prune-vtables",
467470
"Mark class methods that do not require vtable dispatch")
468471
PASS_RANGE(AllPasses, AADumper, PruneVTables)

lib/SILOptimizer/Mandatory/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ target_sources(swiftSILOptimizer PRIVATE
2929
MoveOnlyDeinitInsertion.cpp
3030
MoveOnlyDiagnostics.cpp
3131
MoveOnlyObjectChecker.cpp
32-
MoveOnlyUtils.cpp
3332
NestedSemanticFunctionCheck.cpp
3433
OptimizeHopToExecutor.cpp
3534
PerformanceDiagnostics.cpp

0 commit comments

Comments
 (0)