From c9f2f61d3426d30605b22ccbd112272d1d36cd28 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 10 Mar 2011 20:57:44 +0000 Subject: [PATCH] RecursivelyDeleteTriviallyDeadInstructions only needs a Value, not an Instruction, so casting is not necessary. Also, it's theoretically possible that the Value is not an Instruction, since WeakVH follows RAUWs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127427 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/Reassociate.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 6a0fb3f7789..accabb024dd 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -1097,9 +1097,8 @@ bool Reassociate::runOnFunction(Function &F) { // Now that we're done, delete any instructions which are no longer used. while (!DeadInsts.empty()) - if (Instruction *Inst = - cast_or_null((Value *)DeadInsts.pop_back_val())) - RecursivelyDeleteTriviallyDeadInstructions(Inst); + if (Value *V = DeadInsts.pop_back_val()) + RecursivelyDeleteTriviallyDeadInstructions(V); // We are done with the rank map. RankMap.clear(); -- 2.34.1