From 62f4b48fc1d33a5392dc5ed5fc29de05bd7a0e25 Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Sat, 22 Mar 2014 01:49:30 +0000 Subject: [PATCH] [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 --- lib/Transforms/Scalar/ConstantHoisting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/ConstantHoisting.cpp b/lib/Transforms/Scalar/ConstantHoisting.cpp index ce2e7eb6bf2..cd0801d1efa 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.