Skip to content

Commit 50798ff

Browse files
committed
[MoveOnlyAddressChecker] NFC: Extracted function.
In preparation to share the getOrCreateConsumingBlock functionality with another overload of recordConsumingBlock.
1 parent eb69897 commit 50798ff

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -763,14 +763,19 @@ struct UseState {
763763
}
764764
}
765765

766-
void recordConsumingBlock(SILBasicBlock *block, TypeTreeLeafTypeRange range) {
766+
SmallBitVector &getOrCreateConsumingBlock(SILBasicBlock *block) {
767767
auto iter = consumingBlocks.find(block);
768768
if (iter == consumingBlocks.end()) {
769769
iter =
770770
consumingBlocks.insert({block, SmallBitVector(getNumSubelements())})
771771
.first;
772772
}
773-
range.setBits(iter->second);
773+
return iter->second;
774+
}
775+
776+
void recordConsumingBlock(SILBasicBlock *block, TypeTreeLeafTypeRange range) {
777+
auto &consumingBits = getOrCreateConsumingBlock(block);
778+
range.setBits(consumingBits);
774779
}
775780

776781
void

0 commit comments

Comments
 (0)