[Constant Hoisting] Erase dead cast instructions.

The cleanup code that removes dead cast instructions only removed them from the
basic block, but didn't delete them. This fix erases them now too.

llvm-svn: 204538
This commit is contained in:
Juergen Ributzka 2014-03-22 01:49:30 +00:00
parent e802d507b0
commit e474752f4c
1 changed files with 1 additions and 1 deletions

View File

@ -595,7 +595,7 @@ bool ConstantHoisting::emitBaseConstants() {
void ConstantHoisting::deleteDeadCastInst() const {
for (auto const &I : ClonedCastMap)
if (I.first->use_empty())
I.first->removeFromParent();
I.first->eraseFromParent();
}
/// \brief Optimize expensive integer constants in the given function.