Skip to content

Commit 70a14ff

Browse files
committed
Rename ForwardingOperand.getOwnershipKind()
to getForwardingOwnershipKind() just to distinguish it from SILValue.getOwnershipKind() and be able to grep for them each.
1 parent 60dc24b commit 70a14ff

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ class ForwardingOperand {
172172
return use->getOwnershipConstraint();
173173
}
174174

175-
ValueOwnershipKind getOwnershipKind() const;
176-
void setOwnershipKind(ValueOwnershipKind newKind) const;
175+
ValueOwnershipKind getForwardingOwnershipKind() const;
176+
void setForwardingOwnershipKind(ValueOwnershipKind newKind) const;
177177
void replaceOwnershipKind(ValueOwnershipKind oldKind,
178178
ValueOwnershipKind newKind) const;
179179

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ ForwardingOperand::ForwardingOperand(Operand *use) {
11241124
this->use = use;
11251125
}
11261126

1127-
ValueOwnershipKind ForwardingOperand::getOwnershipKind() const {
1127+
ValueOwnershipKind ForwardingOperand::getForwardingOwnershipKind() const {
11281128
auto *user = use->getUser();
11291129

11301130
// NOTE: This if chain is meant to be a covered switch, so make sure to return
@@ -1156,7 +1156,8 @@ ValueOwnershipKind ForwardingOperand::getOwnershipKind() const {
11561156
llvm_unreachable("Unhandled forwarding inst?!");
11571157
}
11581158

1159-
void ForwardingOperand::setOwnershipKind(ValueOwnershipKind newKind) const {
1159+
void ForwardingOperand::setForwardingOwnershipKind(
1160+
ValueOwnershipKind newKind) const {
11601161
auto *user = use->getUser();
11611162
// NOTE: This if chain is meant to be a covered switch, so make sure to return
11621163
// in each if itself since we have an unreachable at the bottom to ensure if a

lib/SILOptimizer/Utils/CanonicalizeBorrowScope.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ class RewriteInnerBorrowUses {
455455
// Update this operand bypassing any copies.
456456
SILValue value = use->get();
457457
use->set(scope.findDefInBorrowScope(value));
458-
ForwardingOperand(use).setOwnershipKind(OwnershipKind::Guaranteed);
458+
ForwardingOperand(use).setForwardingOwnershipKind(
459+
OwnershipKind::Guaranteed);
459460
deleteCopyChain(value, scope.getDeleter());
460461
return true;
461462
}
@@ -570,7 +571,8 @@ class RewriteOuterBorrowUses {
570571
LLVM_DEBUG(llvm::dbgs() << " Deleted " << *user);
571572
} else {
572573
use->set(scope.findDefInBorrowScope(use->get()));
573-
ForwardingOperand(use).setOwnershipKind(OwnershipKind::Guaranteed);
574+
ForwardingOperand(use).setForwardingOwnershipKind(
575+
OwnershipKind::Guaranteed);
574576
}
575577
deleteCopyChain(innerValue, scope.getDeleter());
576578
return true;
@@ -659,7 +661,7 @@ SILValue RewriteOuterBorrowUses::createOuterValues(SILValue innerValue) {
659661
scope.getCallbacks().createdNewInst(clone);
660662
Operand *use = &clone->getOperandRef(0);
661663
use->set(incomingOuterVal);
662-
ForwardingOperand(use).setOwnershipKind(OwnershipKind::Owned);
664+
ForwardingOperand(use).setForwardingOwnershipKind(OwnershipKind::Owned);
663665

664666
LLVM_DEBUG(llvm::dbgs() << " Hoisted forward " << *clone);
665667

0 commit comments

Comments
 (0)