diff --git a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp index ce2e7eb6bf22..cd0801d1efa5 100644 --- a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp +++ b/llvm/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.