Skip to content

Commit a0c85be

Browse files
committed
OwnershipLiveness: handle ProjectBox like an interior pointer.
1 parent 28c1fdb commit a0c85be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ extension OwnershipUseVisitor {
357357
return .continueWalk
358358

359359
case .pointerEscape:
360+
// TODO: Change ProjectBox ownership to InteriorPointer and allow them to take owned values.
361+
if operand.instruction is ProjectBoxInst {
362+
return visitInteriorPointerUse(of: operand)
363+
}
360364
return pointerEscapingUse(of: operand)
361365

362366
case .instantaneousUse, .forwardingUnowned, .unownedInstantaneousUse,
@@ -395,8 +399,6 @@ extension OwnershipUseVisitor {
395399
}
396400
}
397401

398-
// TODO: Change ProjectBox ownership to InteriorPointer and allow
399-
// owned interior pointers.
400402
private mutating func visitInteriorPointerUse(of operand: Operand)
401403
-> WalkResult {
402404
switch operand.instruction {

0 commit comments

Comments
 (0)