Fix Block::eraseArguments: keep track the first removed element while removing
authorMehdi Amini <joker.eph@gmail.com>
Sat, 27 Feb 2021 19:18:09 +0000 (19:18 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Sat, 27 Feb 2021 19:18:09 +0000 (19:18 +0000)
commit014575932fc3acbb0f1c5b46ff2bfcebf69e6e62
treed2902c0af55522095f1f2ebac05fee8be13d7584
parent7b06786de239a4ab7d53ee8ca0b2f5a9b15a871a
Fix Block::eraseArguments: keep track the first removed element while removing

Not only this is likely more efficient than BitVector::find_first(), but
also if the BitVector is empty find_first() returns -1, which
llvm::drop_begin isn't robust against.
mlir/lib/IR/Block.cpp