Assert that we aren't erasing a block argument that has uses.

This fires in a bug I am investigating.
This commit is contained in:
Mark Lacey
2016-03-07 15:49:50 -08:00
parent 55856876e0
commit bdc5667d1a

View File

@@ -141,6 +141,8 @@ SILArgument *SILBasicBlock::insertBBArg(bbarg_iterator Iter, SILType Ty,
}
void SILBasicBlock::eraseBBArg(int Index) {
assert(getBBArg(Index)->use_empty() &&
"Erasing block argument that has uses!");
// Notify the delete handlers that this BB argument is going away.
getModule().notifyDeleteHandlers(getBBArg(Index));
BBArgList.erase(BBArgList.begin() + Index);