diff --git a/llvm/include/llvm/Analysis/RegionInfoImpl.h b/llvm/include/llvm/Analysis/RegionInfoImpl.h --- a/llvm/include/llvm/Analysis/RegionInfoImpl.h +++ b/llvm/include/llvm/Analysis/RegionInfoImpl.h @@ -585,10 +585,8 @@ // Exit is the header of a loop that contains the entry. In this case, // the dominance frontier must only contain the exit. if (!DT->dominates(entry, exit)) { - for (typename DST::iterator SI = entrySuccs->begin(), - SE = entrySuccs->end(); - SI != SE; ++SI) { - if (*SI != exit && *SI != entry) + for (BlockT *successor : *entrySuccs) { + if (successor != exit && successor != entry) return false; }