summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/pretty_printer.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-02-25 14:22:56 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-02-26 13:24:04 +0000
commitbe9a92aa804c0d210f80966b74ef8ed3987f335a (patch)
tree10d58622f626f03156e0dec1f1fc00616554b336 /compiler/optimizing/pretty_printer.h
parent3188d117d6f1ba5f3a30d0ff231d816ebb59a7f7 (diff)
downloadart-be9a92aa804c0d210f80966b74ef8ed3987f335a.zip
art-be9a92aa804c0d210f80966b74ef8ed3987f335a.tar.gz
art-be9a92aa804c0d210f80966b74ef8ed3987f335a.tar.bz2
Add conditional branches, and build dominator tree.
Change-Id: I4b151a07b72692961235a1419b54b6b45cf54e63
Diffstat (limited to 'compiler/optimizing/pretty_printer.h')
-rw-r--r--compiler/optimizing/pretty_printer.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/optimizing/pretty_printer.h b/compiler/optimizing/pretty_printer.h
index 62a5a2c..d4b6165 100644
--- a/compiler/optimizing/pretty_printer.h
+++ b/compiler/optimizing/pretty_printer.h
@@ -34,6 +34,24 @@ class HPrettyPrinter : public HGraphVisitor {
virtual void VisitBasicBlock(HBasicBlock* block) {
PrintString("BasicBlock ");
PrintInt(block->block_id());
+ const GrowableArray<HBasicBlock*>* blocks = block->predecessors();
+ if (!blocks->IsEmpty()) {
+ PrintString(", pred: ");
+ for (size_t i = 0; i < blocks->Size() -1; i++) {
+ PrintInt(blocks->Get(i)->block_id());
+ PrintString(", ");
+ }
+ PrintInt(blocks->Peek()->block_id());
+ }
+ blocks = block->successors();
+ if (!blocks->IsEmpty()) {
+ PrintString(", succ: ");
+ for (size_t i = 0; i < blocks->Size() - 1; i++) {
+ PrintInt(blocks->Get(i)->block_id());
+ PrintString(", ");
+ }
+ PrintInt(blocks->Peek()->block_id());
+ }
PrintNewLine();
HGraphVisitor::VisitBasicBlock(block);
}