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

Side by Side Diff: runtime/vm/il_printer.h

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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
« no previous file with comments | « runtime/vm/heap_test.cc ('k') | runtime/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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_IL_PRINTER_H_ 5 #ifndef RUNTIME_VM_IL_PRINTER_H_
6 #define RUNTIME_VM_IL_PRINTER_H_ 6 #define RUNTIME_VM_IL_PRINTER_H_
7 7
8 #include "vm/flow_graph.h" 8 #include "vm/flow_graph.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 class BufferFormatter : public ValueObject { 13 class BufferFormatter : public ValueObject {
14 public: 14 public:
15 BufferFormatter(char* buffer, intptr_t size) 15 BufferFormatter(char* buffer, intptr_t size)
16 : position_(0), 16 : position_(0), buffer_(buffer), size_(size) {}
17 buffer_(buffer),
18 size_(size) { }
19 17
20 void VPrint(const char* format, va_list args); 18 void VPrint(const char* format, va_list args);
21 void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); 19 void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
22 20
23 private: 21 private:
24 intptr_t position_; 22 intptr_t position_;
25 char* buffer_; 23 char* buffer_;
26 const intptr_t size_; 24 const intptr_t size_;
27 25
28 DISALLOW_COPY_AND_ASSIGN(BufferFormatter); 26 DISALLOW_COPY_AND_ASSIGN(BufferFormatter);
29 }; 27 };
30 28
31 29
32 class ParsedFunction; 30 class ParsedFunction;
33 31
34 32
35 // Graph printing. 33 // Graph printing.
36 class FlowGraphPrinter : public ValueObject { 34 class FlowGraphPrinter : public ValueObject {
37 public: 35 public:
38 static const intptr_t kPrintAll = -1; 36 static const intptr_t kPrintAll = -1;
39 37
40 FlowGraphPrinter(const FlowGraph& flow_graph, 38 explicit FlowGraphPrinter(const FlowGraph& flow_graph,
41 bool print_locations = false) 39 bool print_locations = false)
42 : function_(flow_graph.function()), 40 : function_(flow_graph.function()),
43 block_order_(flow_graph.reverse_postorder()), 41 block_order_(flow_graph.reverse_postorder()),
44 print_locations_(print_locations) { } 42 print_locations_(print_locations) {}
45 43
46 // Print the instructions in a block terminated by newlines. Add "goto N" 44 // Print the instructions in a block terminated by newlines. Add "goto N"
47 // to the end of the block if it ends with an unconditional jump to 45 // to the end of the block if it ends with an unconditional jump to
48 // another block and that block is not next in reverse postorder. 46 // another block and that block is not next in reverse postorder.
49 void PrintBlocks(); 47 void PrintBlocks();
50 void PrintInstruction(Instruction* instr); 48 void PrintInstruction(Instruction* instr);
51 static void PrintOneInstruction(Instruction* instr, bool print_locations); 49 static void PrintOneInstruction(Instruction* instr, bool print_locations);
52 static void PrintTypeCheck(const ParsedFunction& parsed_function, 50 static void PrintTypeCheck(const ParsedFunction& parsed_function,
53 TokenPosition token_pos, 51 TokenPosition token_pos,
54 Value* value, 52 Value* value,
(...skipping 15 matching lines...) Expand all
70 68
71 private: 69 private:
72 const Function& function_; 70 const Function& function_;
73 const GrowableArray<BlockEntryInstr*>& block_order_; 71 const GrowableArray<BlockEntryInstr*>& block_order_;
74 const bool print_locations_; 72 const bool print_locations_;
75 }; 73 };
76 74
77 } // namespace dart 75 } // namespace dart
78 76
79 #endif // RUNTIME_VM_IL_PRINTER_H_ 77 #endif // RUNTIME_VM_IL_PRINTER_H_
OLDNEW
« no previous file with comments | « runtime/vm/heap_test.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698