Skip to content

Commit d6ab215

Browse files
committed
[NFC] Renamed helper function.
1 parent 2d75d7f commit d6ab215

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILOptimizer/Utils/ShrinkBorrowScope.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class ShrinkBorrowScope {
117117
mayAccessPointer(instruction) || mayLoadWeakOrUnowned(instruction);
118118
}
119119

120-
bool canReplaceValueWithBorrowedValue(SILValue value) {
120+
bool canReplaceValueWithBorrowee(SILValue value) {
121121
while (true) {
122122
auto *instruction = value.getDefiningInstruction();
123123
if (!instruction)
@@ -145,7 +145,7 @@ class ShrinkBorrowScope {
145145
if (users.contains(instruction)) {
146146
if (auto *bbi = dyn_cast<BeginBorrowInst>(instruction)) {
147147
if (bbi->isLexical() &&
148-
canReplaceValueWithBorrowedValue(bbi->getOperand())) {
148+
canReplaceValueWithBorrowee(bbi->getOperand())) {
149149
if (rewrite) {
150150
auto borrowee = introducer->getOperand();
151151
bbi->setOperand(borrowee);
@@ -154,7 +154,7 @@ class ShrinkBorrowScope {
154154
return true;
155155
}
156156
} else if (auto *cvi = dyn_cast<CopyValueInst>(instruction)) {
157-
if (canReplaceValueWithBorrowedValue(cvi->getOperand())) {
157+
if (canReplaceValueWithBorrowee(cvi->getOperand())) {
158158
if (rewrite) {
159159
auto borrowee = introducer->getOperand();
160160
cvi->setOperand(borrowee);

0 commit comments

Comments
 (0)