[C++11] Add a basic block range view for RegionInfo
[oota-llvm.git] / lib / Analysis / RegionInfo.cpp
index 876d86b785b94c2f3f20007fe53cf71031a0ba34..f4da598d844480fc2cc9b3b38796f850be1bb969 100644 (file)
@@ -438,8 +438,8 @@ void Region::print(raw_ostream &OS, bool print_tree, unsigned level,
     OS.indent(level*2 + 2);
 
     if (Style == PrintBB) {
-      for (const_block_iterator I = block_begin(), E = block_end(); I != E; ++I)
-        OS << (*I)->getName() << ", "; // TODO: remove the last ","
+      for (const auto &BB : blocks())
+        OS << BB->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 ",