Improve encapsulation in the Loop and LoopInfo classes by eliminating the
getSubLoops/getTopLevelLoops methods, replacing them with iterator-based
accessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10714 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index 68e7d2f..41c4b55 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -72,8 +72,8 @@
 
   OS << "\n";
 
-  for (unsigned i = 0, e = getSubLoops().size(); i != e; ++i)
-    getSubLoops()[i]->print(OS, Depth+2);
+  for (iterator I = begin(), E = end(); I != E; ++I)
+    (*I)->print(OS, Depth+2);
 }
 
 void Loop::dump() const {