From 57bd7dc8242bff25b7173df97485dbffb70741e5 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 9 Oct 2015 18:40:15 +0000 Subject: [PATCH] Add iterator ranges for blocks in a Loop. llvm-svn: 249873 --- include/llvm/Analysis/LoopInfo.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 841c002a5c6..cc02c3db667 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -140,6 +140,9 @@ public: typedef typename std::vector::const_iterator block_iterator; block_iterator block_begin() const { return Blocks.begin(); } block_iterator block_end() const { return Blocks.end(); } + inline iterator_range blocks() const { + return iterator_range(block_begin(), block_end()); + } /// getNumBlocks - Get the number of blocks in this loop in constant time. unsigned getNumBlocks() const {