mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 06:33:21 +00:00
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
This commit is contained in:
parent
9d2234d6a0
commit
c9f2f61d34
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user