Use range based for loops to avoid needing to re-mention SmallPtrSet size.
[oota-llvm.git] / lib / Transforms / Scalar / Sink.cpp
index 2f4e23a7488b453521de0094489186fcbb68f4bb..903b675fdd56e3ae56e166677801ae5b3e1d4073 100644 (file)
@@ -166,9 +166,8 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis *AA,
 
   if (LoadInst *L = dyn_cast<LoadInst>(Inst)) {
     AliasAnalysis::Location Loc = AA->getLocation(L);
-    for (SmallPtrSet<Instruction *, 8>::iterator I = Stores.begin(),
-         E = Stores.end(); I != E; ++I)
-      if (AA->getModRefInfo(*I, Loc) & AliasAnalysis::Mod)
+    for (Instruction *S : Stores)
+      if (AA->getModRefInfo(S, Loc) & AliasAnalysis::Mod)
         return false;
   }