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

Unified Diff: vm/flow_graph_builder.cc

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, 7 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
« no previous file with comments | « no previous file | vm/il_printer.h » ('j') | vm/il_printer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/flow_graph_builder.cc
===================================================================
--- vm/flow_graph_builder.cc (revision 8145)
+++ vm/flow_graph_builder.cc (working copy)
@@ -24,6 +24,7 @@
"Eliminate type checks when allowed by static type analysis");
DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree.");
DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph.");
+DEFINE_FLAG(bool, print_flow_graph_file, false, "Print the IR into a file.");
DECLARE_FLAG(bool, enable_type_checks);
@@ -2301,14 +2302,20 @@
GrowableArray<BitVector*> dominance_frontier;
ComputeDominators(&preorder_block_entries_, &parent, &dominance_frontier);
}
- if (FLAG_print_flow_graph) {
+ if (FLAG_print_flow_graph || FLAG_print_flow_graph_file) {
intptr_t length = postorder_block_entries_.length();
GrowableArray<BlockEntryInstr*> reverse_postorder(length);
for (intptr_t i = length - 1; i >= 0; --i) {
reverse_postorder.Add(postorder_block_entries_[i]);
}
- FlowGraphPrinter printer(function, reverse_postorder);
- printer.PrintBlocks();
+ if (FLAG_print_flow_graph) {
+ FlowGraphPrinter printer(function, reverse_postorder);
+ printer.PrintBlocks();
+ }
+ if (FLAG_print_flow_graph_file) {
+ FlowGraphVisualizer printer(function, reverse_postorder);
+ printer.PrintFunction();
+ }
}
}
« no previous file with comments | « no previous file | vm/il_printer.h » ('j') | vm/il_printer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698