diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-05-04 20:55:23 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-05-04 20:55:23 +0000 |
commit | 8880325a92601d52c586a642cf4fb634bae81b13 (patch) | |
tree | 7d6def46d77088780c7a6f5e77e7f63fea761e4b /llvm/lib/Analysis/RegionPass.cpp | |
parent | c8f73d7b9604042bf2a507d3878b291a646aaeef (diff) | |
download | bcm5719-llvm-8880325a92601d52c586a642cf4fb634bae81b13.tar.gz bcm5719-llvm-8880325a92601d52c586a642cf4fb634bae81b13.zip |
Rename the Region::block_iterator to Region::block_node_iterator, and
add a new Region::block_iterator which actually iterates over the basic
blocks of the region.
The old iterator, now call 'block_node_iterator' iterates over
RegionNodes which contain a single basic block. This works well with the
GraphTraits-based iterator design, however most users actually want an
iterator over the BasicBlocks inside these RegionNodes. Now the
'block_iterator' is a wrapper which exposes exactly this interface.
Internally it uses the block_node_iterator to walk all nodes which are
single basic blocks, but transparently unwraps the basic block to make
user code simpler.
While this patch is a bit of a wash, most of the updates are to internal
users, not external users of the RegionInfo. I have an accompanying
patch to Polly that is a strict simplification of every user of this
interface, and I'm working on a pass that also wants the same simplified
interface.
This patch alone should have no functional impact.
llvm-svn: 156202
Diffstat (limited to 'llvm/lib/Analysis/RegionPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/RegionPass.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp index 3a3529baf93..c97b5ebd7d0 100644 --- a/llvm/lib/Analysis/RegionPass.cpp +++ b/llvm/lib/Analysis/RegionPass.cpp @@ -195,7 +195,8 @@ public: virtual bool runOnRegion(Region *R, RGPassManager &RGM) { Out << Banner; - for (Region::block_iterator I = R->block_begin(), E = R->block_end(); + for (Region::block_node_iterator I = R->block_node_begin(), + E = R->block_node_end(); I != E; ++I) (*I)->getEntry()->print(Out); |