[llvm-commits] [Please review][PATCH] Implement the block_iterator of Region based on df_iterator.

Hongbin Zheng etherzhhb at gmail.com
Sun Aug 26 20:06:51 PDT 2012


Hi,

I attached a patch that make the function "Region::print" use the
newly introduced block_iterator instead of the block_node_iterator.
With this patch, the block_iterator is actually tested by the regression tests.

best regards
ether
---
 lib/Analysis/RegionInfo.cpp |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp
index 868f483..10797eb 100644
--- a/lib/Analysis/RegionInfo.cpp
+++ b/lib/Analysis/RegionInfo.cpp
@@ -47,7 +47,7 @@ static cl::opt<enum Region::PrintStyle>
printStyle("print-region-style",
   cl::values(
     clEnumValN(Region::PrintNone, "none",  "print no details"),
     clEnumValN(Region::PrintBB, "bb",
-               "print regions in detail with block_node_iterator"),
+               "print regions in detail with block_iterator"),
     clEnumValN(Region::PrintRN, "rn",
                "print regions in detail with element_iterator"),
     clEnumValEnd));
@@ -425,10 +425,8 @@ void Region::print(raw_ostream &OS, bool
print_tree, unsigned level,
     OS.indent(level*2 + 2);

     if (Style == PrintBB) {
-      for (const_block_node_iterator I = block_node_begin(),
-                                     E = block_node_end();
-           I != E; ++I)
-        OS << **I << ", "; // TODO: remove the last ","
+      for (const_block_iterator I = block_begin(), E = block_end(); I
!= E; ++I)
+        OS << (*I)->getName() << ", "; // TODO: remove the last ","
     } else if (Style == PrintRN) {
       for (const_element_iterator I = element_begin(), E =
element_end(); I!=E; ++I)
         OS << **I << ", "; // TODO: remove the last ",
-- 
1.7.5.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-block_iterator-in-function-Region-print.patch
Type: text/x-diff
Size: 1641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120827/505fb87c/attachment.patch>


More information about the llvm-commits mailing list