summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-03-10 20:57:44 +0000
committerDan Gohman <gohman@apple.com>2011-03-10 20:57:44 +0000
commitaffbc66f6085752ea974f71deec4113e1f7f45c5 (patch)
treede912d7c9e6186557d99626402c6f370e73226fc /llvm/lib/Transforms
parentcbe6a1ae86acc54ab5fa0b6692c3de44f532c611 (diff)
downloadbcm5719-llvm-affbc66f6085752ea974f71deec4113e1f7f45c5.tar.gz
bcm5719-llvm-affbc66f6085752ea974f71deec4113e1f7f45c5.zip
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. llvm-svn: 127427
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/Reassociate.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index 6a0fb3f7789..accabb024dd 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/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<Instruction>((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();
OpenPOWER on IntegriCloud