[llvm] r249873 - Add iterator ranges for blocks in a Loop.

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 11:40:15 PDT 2015


Author: resistor
Date: Fri Oct  9 13:40:15 2015
New Revision: 249873

URL: http://llvm.org/viewvc/llvm-project?rev=249873&view=rev
Log:
Add iterator ranges for blocks in a Loop.

Modified:
    llvm/trunk/include/llvm/Analysis/LoopInfo.h

Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=249873&r1=249872&r2=249873&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Fri Oct  9 13:40:15 2015
@@ -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 {




More information about the llvm-commits mailing list