Skip to content

Commit b08eb62

Browse files
committed
Rename SinkAddressProjections::projections -> SinkAddressProjections::oldProjections
1 parent 60d82c7 commit b08eb62

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

include/swift/SILOptimizer/Utils/BasicBlockOptUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ bool canCloneTerminator(TermInst *termInst);
135135
/// BasicBlockCloner handles this internally.
136136
class SinkAddressProjections {
137137
// Projections ordered from last to first in the chain.
138-
SmallVector<SingleValueInstruction *, 4> projections;
138+
SmallVector<SingleValueInstruction *, 4> oldProjections;
139139
SmallSetVector<SILValue, 4> inBlockDefs;
140140

141141
// Transient per-projection data for use during cloning.

lib/SILOptimizer/Utils/BasicBlockOptUtils.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void BasicBlockCloner::sinkAddressProjections() {
223223
//
224224
// Return true on success, even if projections is empty.
225225
bool SinkAddressProjections::analyzeAddressProjections(SILInstruction *inst) {
226-
projections.clear();
226+
oldProjections.clear();
227227
inBlockDefs.clear();
228228

229229
SILBasicBlock *bb = inst->getParent();
@@ -237,7 +237,7 @@ bool SinkAddressProjections::analyzeAddressProjections(SILInstruction *inst) {
237237
}
238238
if (auto *addressProj = dyn_cast<SingleValueInstruction>(def)) {
239239
if (addressProj->isPure()) {
240-
projections.push_back(addressProj);
240+
oldProjections.push_back(addressProj);
241241
return true;
242242
}
243243
}
@@ -252,12 +252,12 @@ bool SinkAddressProjections::analyzeAddressProjections(SILInstruction *inst) {
252252
return false;
253253
}
254254
// Recurse upward through address projections.
255-
for (unsigned idx = 0; idx < projections.size(); ++idx) {
255+
for (unsigned idx = 0; idx < oldProjections.size(); ++idx) {
256256
// Only one address result/operand can be handled per instruction.
257-
if (projections.size() != idx + 1)
257+
if (oldProjections.size() != idx + 1)
258258
return false;
259259

260-
for (SILValue operandVal : projections[idx]->getOperandValues())
260+
for (SILValue operandVal : oldProjections[idx]->getOperandValues())
261261
if (!pushOperandVal(operandVal))
262262
return false;
263263
}
@@ -267,13 +267,13 @@ bool SinkAddressProjections::analyzeAddressProjections(SILInstruction *inst) {
267267
// Clone the projections gathered by 'analyzeAddressProjections' at
268268
// their use site outside this block.
269269
bool SinkAddressProjections::cloneProjections() {
270-
if (projections.empty())
270+
if (oldProjections.empty())
271271
return false;
272272

273-
SILBasicBlock *bb = projections.front()->getParent();
273+
SILBasicBlock *bb = oldProjections.front()->getParent();
274274
// Clone projections in last-to-first order.
275-
for (unsigned idx = 0; idx < projections.size(); ++idx) {
276-
auto *oldProj = projections[idx];
275+
for (unsigned idx = 0; idx < oldProjections.size(); ++idx) {
276+
auto *oldProj = oldProjections[idx];
277277
assert(oldProj->getParent() == bb);
278278
// Reset transient per-projection sets.
279279
usesToReplace.clear();

0 commit comments

Comments
 (0)