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
This commit is contained in:
Dan Gohman 2011-03-10 20:57:44 +00:00
parent cbe6a1ae86
commit affbc66f60
1 changed files with 2 additions and 3 deletions

View File

@ -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();