summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-06-24 22:23:21 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-06-24 22:23:21 +0000
commit817ac8f40a077ff20b98164c569c4063e103d215 (patch)
tree945ea61df79068af1065a33ebe7b42f0fe7828ce /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parentfcda6f8c6bb828c48e6d406a9bf2bc1d55bf9037 (diff)
downloadbcm5719-llvm-817ac8f40a077ff20b98164c569c4063e103d215.tar.gz
bcm5719-llvm-817ac8f40a077ff20b98164c569c4063e103d215.zip
Add simplify_type<const WeakVH>; simplify IndVarSimplify
r240214 fixed some UB in IndVarSimplify, and it needed a temporary `WeakVH` to do it. Add `simplify_type<const WeakVH>` so that this temporary isn't necessary. llvm-svn: 240599
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 5c9cf1a4393..6f0375487af 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2013,11 +2013,10 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// Now that we're done iterating through lists, clean up any instructions
// which are now dead.
- while (!DeadInsts.empty()) {
- Value *V = static_cast<Value *>(DeadInsts.pop_back_val());
- if (Instruction *Inst = dyn_cast_or_null<Instruction>(V))
+ while (!DeadInsts.empty())
+ if (Instruction *Inst =
+ dyn_cast_or_null<Instruction>(DeadInsts.pop_back_val()))
RecursivelyDeleteTriviallyDeadInstructions(Inst, TLI);
- }
// The Rewriter may not be used from this point on.
OpenPOWER on IntegriCloud