Skip to content

Commit 2b363c5

Browse files
committed
[NFC] MoveOnly: Renamed nonconsumingUses.
The name `livenessUses` doesn't readily communicate the fact that those uses are all non-consuming.
1 parent 7feb7e2 commit 2b363c5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,9 @@ struct UseState {
529529
/// A map from destroy_addr to the part of the type that it destroys.
530530
llvm::SmallMapVector<SILInstruction *, TypeTreeLeafTypeRange, 4> destroys;
531531

532-
/// A map from a liveness requiring use to the part of the type that it
533-
/// requires liveness for.
534-
InstToBitMap livenessUses;
532+
/// Maps a non-consuming use to the part of the type that it requires
533+
/// liveness for.
534+
InstToBitMap nonconsumingUses;
535535

536536
/// A map from a load [copy] or load [take] that we determined must be
537537
/// converted to a load_borrow to the part of the type tree that it needs to
@@ -635,11 +635,11 @@ struct UseState {
635635
}
636636

637637
void recordLivenessUse(SILInstruction *inst, SmallBitVector const &bits) {
638-
setAffectedBits(inst, bits, livenessUses);
638+
setAffectedBits(inst, bits, nonconsumingUses);
639639
}
640640

641641
void recordLivenessUse(SILInstruction *inst, TypeTreeLeafTypeRange range) {
642-
setAffectedBits(inst, range, livenessUses);
642+
setAffectedBits(inst, range, nonconsumingUses);
643643
}
644644

645645
void recordReinitUse(SILInstruction *inst, SILValue value,
@@ -702,7 +702,7 @@ struct UseState {
702702
cachedNumSubelements = std::nullopt;
703703
consumingBlocks.clear();
704704
destroys.clear();
705-
livenessUses.clear();
705+
nonconsumingUses.clear();
706706
borrows.clear();
707707
copyInsts.clear();
708708
takeInsts.clear();
@@ -722,7 +722,7 @@ struct UseState {
722722
llvm::dbgs() << *pair.first;
723723
}
724724
llvm::dbgs() << "LivenessUses:\n";
725-
for (auto pair : livenessUses) {
725+
for (auto pair : nonconsumingUses) {
726726
llvm::dbgs() << *pair.first;
727727
}
728728
llvm::dbgs() << "Borrows:\n";
@@ -826,8 +826,8 @@ struct UseState {
826826

827827
bool isLivenessUse(SILInstruction *inst, TypeTreeLeafTypeRange span) const {
828828
{
829-
auto iter = livenessUses.find(inst);
830-
if (iter != livenessUses.end()) {
829+
auto iter = nonconsumingUses.find(inst);
830+
if (iter != nonconsumingUses.end()) {
831831
if (span.intersects(iter->second))
832832
return true;
833833
}
@@ -1253,7 +1253,7 @@ void UseState::initializeLiveness(
12531253
liveness.print(llvm::dbgs()));
12541254
}
12551255

1256-
for (auto livenessInstAndValue : livenessUses) {
1256+
for (auto livenessInstAndValue : nonconsumingUses) {
12571257
if (auto *lbi = dyn_cast<LoadBorrowInst>(livenessInstAndValue.first)) {
12581258
auto accessPathWithBase =
12591259
AccessPathWithBase::computeInScope(lbi->getOperand());

0 commit comments

Comments
 (0)