Skip to content

Commit

Permalink
Add iterator ranges for blocks in a Loop.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249873 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
resistor committed Oct 9, 2015
1 parent 7e15cfe commit 9f41a7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/llvm/Analysis/LoopInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ class LoopBase {
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 {
Expand Down

0 comments on commit 9f41a7c

Please sign in to comment.