summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-03-22 01:49:30 +0000
committerJuergen Ributzka <juergen@apple.com>2014-03-22 01:49:30 +0000
commit62f4b48fc1d33a5392dc5ed5fc29de05bd7a0e25 (patch)
tree04dd643295893265c98568a5ac4e6c8cee6c5702
parent5cfc91c9a524efb027e6a639ef69fd0ca8911389 (diff)
downloadllvm-62f4b48fc1d33a5392dc5ed5fc29de05bd7a0e25.tar.gz
llvm-62f4b48fc1d33a5392dc5ed5fc29de05bd7a0e25.tar.bz2
llvm-62f4b48fc1d33a5392dc5ed5fc29de05bd7a0e25.tar.xz
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204538 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/ConstantHoisting.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/ConstantHoisting.cpp b/lib/Transforms/Scalar/ConstantHoisting.cpp
index ce2e7eb6bf..cd0801d1ef 100644
--- a/lib/Transforms/Scalar/ConstantHoisting.cpp
+++ b/lib/Transforms/Scalar/ConstantHoisting.cpp
@@ -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.