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

Side by Side Diff: vm/il_printer.h

Issue 10398015: Move FlowGraphPrinter to a new 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/flow_graph_builder.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef VM_IL_PRINTER_H_
6 #define VM_IL_PRINTER_H_
7
8 #include "vm/intermediate_language.h"
9
10 namespace dart {
11
12 // Graph printing.
13 class FlowGraphPrinter : public FlowGraphVisitor {
14 public:
15 FlowGraphPrinter(const Function& function,
16 const GrowableArray<BlockEntryInstr*>& block_order)
17 : FlowGraphVisitor(block_order), function_(function) { }
18
19 virtual ~FlowGraphPrinter() {}
20
21 // Print the instructions in a block terminated by newlines. Add "goto N"
22 // to the end of the block if it ends with an unconditional jump to
23 // another block and that block is not next in reverse postorder.
24 void VisitBlocks();
25
26 // Visiting a computation prints it with no indentation or newline.
27 #define DECLARE_VISIT_COMPUTATION(ShortName, ClassName) \
28 virtual void Visit##ShortName(ClassName* comp);
29
30 // Visiting an instruction prints it with a four space indent and no
31 // trailing newline. Basic block entries are labeled with their block
32 // number.
33 #define DECLARE_VISIT_INSTRUCTION(ShortName) \
34 virtual void Visit##ShortName(ShortName##Instr* instr);
35
36 FOR_EACH_COMPUTATION(DECLARE_VISIT_COMPUTATION)
37 FOR_EACH_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
38
39 #undef DECLARE_VISIT_COMPUTATION
40 #undef DECLARE_VISIT_INSTRUCTION
41
42 private:
43 const Function& function_;
44
45 DISALLOW_COPY_AND_ASSIGN(FlowGraphPrinter);
46 };
47
48 } // namespace dart
49
50 #endif // VM_IL_PRINTER_H_
OLDNEW
« no previous file with comments | « 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