Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: vm/il_printer.h

Issue 10446116: Add flow graph printing into a .cfg file with flag --print-flow-graph-file. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: vm/il_printer.h
===================================================================
--- vm/il_printer.h (revision 8145)
+++ vm/il_printer.h (working copy)
@@ -16,6 +16,7 @@
buffer_(buffer),
size_(size) { }
+ void VPrint(const char* format, va_list args);
void Print(const char* format, ...);
private:
@@ -34,8 +35,6 @@
const GrowableArray<BlockEntryInstr*>& block_order)
: function_(function), block_order_(block_order) { }
- virtual ~FlowGraphPrinter() {}
-
// Print the instructions in a block terminated by newlines. Add "goto N"
// to the end of the block if it ends with an unconditional jump to
// another block and that block is not next in reverse postorder.
@@ -48,6 +47,27 @@
const GrowableArray<BlockEntryInstr*>& block_order_;
};
+
+class FlowGraphVisualizer : public ValueObject {
+ public:
+ FlowGraphVisualizer(const Function& function,
+ const GrowableArray<BlockEntryInstr*>& block_order)
+ : function_(function), block_order_(block_order), indent_(0) { }
+
+ void PrintFunction();
+
+ private:
+ // Helpers for printing.
+ void PrintInstruction(Instruction* instr);
+ void Print(const char* format, ...);
+
+ const Function& function_;
+ const GrowableArray<BlockEntryInstr*>& block_order_;
+ intptr_t indent_;
+
+ DISALLOW_COPY_AND_ASSIGN(FlowGraphVisualizer);
+};
+
} // namespace dart
#endif // VM_IL_PRINTER_H_
« vm/flow_graph_builder.cc ('K') | « vm/flow_graph_builder.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698