Skip to content

Commit 942d91a

Browse files
committed
[MoveOnlyAddressChecker] NFC: Promoted assertion.
Dumped more info and called llvm_unreachable on bad state.
1 parent 4c02d77 commit 942d91a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2613,7 +2613,12 @@ void MoveOnlyAddressCheckerPImpl::rewriteUses(
26132613
takeInst.second.setBits(bits);
26142614
bool claimedConsume = consumes.claimConsume(takeInst.first, bits);
26152615
(void)claimedConsume;
2616-
assert(claimedConsume && "Should claim all copies?!");
2616+
if (!claimedConsume) {
2617+
llvm::errs()
2618+
<< "Found consume that was not recorded as a 'claimed consume'!\n";
2619+
llvm::errs() << "Unrecorded consume: " << *takeInst.first;
2620+
llvm_unreachable("Standard compiler abort?!");
2621+
}
26172622
}
26182623

26192624
// Then rewrite all copy insts to be takes and claim them.

0 commit comments

Comments
 (0)