Skip to content

Commit fd932a6

Browse files
committed
[SILOpt] Fix build by only accessing seenUse in non-assert builds
1 parent 0037745 commit fd932a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/swift/SILOptimizer/Utils/PrunedLiveness.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class PrunedLiveBlocks {
145145
public:
146146
bool empty() const { return liveBlocks.empty(); }
147147

148-
void clear() { liveBlocks.clear(); seenUse = false; }
148+
void clear() { liveBlocks.clear(); SWIFT_ASSERT_ONLY(seenUse = false); }
149149

150150
void initializeDefBlock(SILBasicBlock *defBB) {
151151
assert(!seenUse && "cannot initialize more defs with partial liveness");

lib/SILOptimizer/Utils/PrunedLiveness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void PrunedLiveBlocks::computeUseBlockLiveness(SILBasicBlock *userBB) {
5050
///
5151
/// Terminators are not live out of the block.
5252
PrunedLiveBlocks::IsLive PrunedLiveBlocks::updateForUse(Operand *use) {
53-
seenUse = true;
53+
SWIFT_ASSERT_ONLY(seenUse = true);
5454

5555
auto *bb = use->getUser()->getParent();
5656
switch (getBlockLiveness(bb)) {

0 commit comments

Comments
 (0)