Provide an interface that is more convenient for iterating over the blocks
[oota-llvm.git] / include / llvm / Analysis / LoopInfo.h
index b85291f5516a1524f926e9632efbeed683599187..5529be3929ee03ed390f7b958a37f1a4d6c969f8 100644 (file)
@@ -74,6 +74,9 @@ public:
   /// getBlocks - Get a list of the basic blocks which make up this loop.
   ///
   const std::vector<BasicBlock*> &getBlocks() const { return Blocks; }
+  typedef std::vector<BasicBlock*>::const_iterator block_iterator;
+  block_iterator block_begin() const { return Blocks.begin(); }
+  block_iterator block_end() const { return Blocks.end(); }
 
   /// isLoopExit - True if terminator in the block can branch to another block
   /// that is outside of the current loop.