Add iterator ranges for blocks in a Loop.
authorOwen Anderson <resistor@mac.com>
Fri, 9 Oct 2015 18:40:15 +0000 (18:40 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 9 Oct 2015 18:40:15 +0000 (18:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249873 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LoopInfo.h

index 841c002..cc02c3d 100644 (file)
@@ -140,6 +140,9 @@ public:
   typedef typename std::vector<BlockT*>::const_iterator block_iterator;
   block_iterator block_begin() const { return Blocks.begin(); }
   block_iterator block_end() const { return Blocks.end(); }
+  inline iterator_range<block_iterator> blocks() const {
+    return iterator_range<block_iterator>(block_begin(), block_end());
+  }
 
   /// getNumBlocks - Get the number of blocks in this loop in constant time.
   unsigned getNumBlocks() const {