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.