This reverts commit r315294. Part of fixing seg fault introduced in:
http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/21675/
llvm-svn: 315328
if (!(V->getType()->isIntegerTy() && IV.isConstantRange()))
return false;
- for (auto UI = V->uses().begin(), E = V->uses().end(); UI != E;) {
- // Advance the iterator here, as we might remove the current use.
- const Use &U = *UI++;
- auto *Icmp = dyn_cast<ICmpInst>(U.getUser());
+ for (auto &Use : V->uses()) {
+ auto *Icmp = dyn_cast<ICmpInst>(Use.getUser());
if (!Icmp)
continue;