1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer
6 ** dump an ir graph, for further use with xvcg
17 /****h* libfirm/irdump
20 * irdump -- dump routines for the graph and all type information
22 * The dump format of most functions is vcg. This is a text based graph
23 * representation. Some use the original format,
24 * but most generate an extended format that is only read by some special
25 * versions of xvcg or by the comercialized version now calles aiSee.
26 * A test version of aiSee is available at
27 * http://www.absint.de/aisee/download/index.htm.
29 * Most routines use the name of the passed entity as the name of the
36 extern char *dump_file_suffix;
38 /****m* irdump/dump_ir_graph
41 * dump_ir_graph -- dump a firm graph
43 * void dump_ir_graph (ir_graph *irg);
45 * Dumps all Firm nodes of a single graph for a single procedure in
46 * standard xvcg format.
47 * Dumps the graph to a file. The file name is constructed from the
48 * name of the entity describing the procedure (irg->entity) and the
49 * ending .vcg. Eventually overwrites existing files.
51 * irg: The firm graph to be dumped.
53 * A file containing the firm graph in vcg format.
58 void dump_ir_graph (ir_graph *irg);
60 /****m* irdump/dump_ir_block_graph
63 * dump_ir_block_graph -- dump a firm graph without explicit block nodes.
65 * void dump_ir_block_graph (ir_graph *irg);
67 * Dumps all Firm nodes of a single graph for a single procedure in
68 * extended xvcg format.
69 * Dumps the graph to a file. The file name is constructed from the
70 * name of the entity describing the procedure (irg->entity) and the
71 * ending .vcg. Eventually overwrites existing files.
73 * irg: The firm graph to be dumped.
75 * A file containing the firm graph in vcg format.
80 void dump_ir_block_graph (ir_graph *irg);
82 /****m* irdump/dump_cfg
85 * dump_cfg -- Dump the control flow graph of a procedure
87 * void dump_cfg (ir_graph *irg);
89 * Dumps the control flow graph of a procedure in standard xvcg format.
90 * Dumps the graph to a file. The file name is constructed from the
91 * name of the entity describing the procedure (irg->entity) and the
92 * ending -cfg.vcg. Eventually overwrites existing files.
94 * irg: The firm graph whose CFG shall be dumped.
96 * A file containing the CFG in vcg format.
101 void dump_cfg (ir_graph *irg);
103 /****m* irdump/dump_type_graph
108 * void dump_type_graph (ir_graph *irg);
110 * Dumps all the type information needed for Calls, Sels, ... in this graph.
111 * Dumps this graph to a file. The file name is constructed from the
112 * name of the entity describing the procedure (irg->entity) and the
113 * ending -type.vcg. Eventually overwrites existing files.
115 * irg: The firm graph whose type information is to be dumped.
117 * A file containing the type information of the firm graph in vcg format.
119 * turn_of_edge_labels
122 void dump_type_graph (ir_graph *irg);
124 /****m* irdump/dump_all_types
127 * dump_all_types -- Dumps all type information
129 * void dump_all_types (void);
131 * Dumps all type information that is somehow reachable in standard vcg
133 * Dumps the graph to a file named All_types.vcg.
137 * A file containing all type information for the program in standard
140 * turn_of_edge_labels
143 void dump_all_types (void);
145 /****m* irdump/dump_class_hierarchy
148 * dump_class_hierarchy -- Dumps the class hierarchy with or without entities.
150 * void dump_class_hierarchy (bool entities);
152 * Dumps a node for all classes and the sub/supertype relations. If
153 * entities is set to true also dumps the entities of classes, but without
154 * any additional information as the entities type. The overwrites relation
155 * is dumped along with the entities.
156 * Dumps to a file class_hierarchy.vcg
158 * Flag whether to dump the entities.
160 * A file containing the class hierarchy tree for the program in standard
166 void dump_class_hierarchy (bool entities);
168 /****m* irdump/dump_ir_graph_w_types
171 * dump_ir_graph_w_types
173 * void dump_ir_graph_w_types (ir_graph *irg);
175 * Dumps a firm graph and all the type information needed for Calls,
176 * Sels, ... in this graph.
177 * Dumps the graph to a file. The file name is constructed from the
178 * name of the entity describing the procedure (irg->entity) and the
179 * ending -all.vcg. Eventually overwrites existing files.
181 * irg: The firm graph to be dumped with its type information.
183 * A file containing the firm graph and the type information of the firm graph in vcg format.
185 * turn_of_edge_labels
189 void dump_ir_graph_w_types (ir_graph *irg);
190 /****m* irdump/dump_ir_block_graph_w_types
193 * dump_ir_block_graph_w_types
195 * void dump_ir_block_graph_w_types (ir_graph *irg);
197 * Dumps a firm graph and all the type information needed for Calls,
198 * Sels, ... in this graph. The graph is in blocked format.
199 * Dumps the graph to a file. The file name is constructed from the
200 * name of the entity describing the procedure (irg->entity) and the
201 * ending -all.vcg. Eventually overwrites existing files.
203 * irg: The firm graph to be dumped with its type information.
205 * A file containing the firm graph and the type information of the firm graph in vcg format.
207 * turn_of_edge_labels
210 void dump_ir_block_graph_w_types (ir_graph *irg);
214 /****m* irdump/dump_cg_graph
219 * void dump_cg_graph (ir_graph *irg);
221 * Dumps a interprocedural firm graph as dump_ir_graph.
223 * irg: The firm graph to be dumped.
225 * A file containing the firm graph in vcg format.
229 void dump_cg_graph(ir_graph * irg);
231 /****m* irdump/dump_cg_block_graph
234 * dump_cg_block_graph
236 * void dump_cg_block_graph (ir_graph *irg);
238 * Dumps a interprocedural firm graph as dump_ir_block_graph.
240 * irg: The firm graph to be dumped.
242 * A file containing the firm graph in vcg format.
246 void dump_cg_block_graph(ir_graph * irg);
249 void dump_all_cg_block_graph();
251 /****m* irdump/dump_all_ir_graphs
254 * dump_all_ir_graphs -- a walker that calls a dumper for each graph
256 * void dump_all_ir_graphs (void dump_graph(ir_graph*));
258 * Walks over all firm graphs and calls a dumper for each graph.
259 * The following dumpers can be passed as arguments:
261 * dump_ir_block_graph
264 * dump_ir_graph_w_types
266 * The dumper to be used for dumping.
268 * Whatever the dumper creates.
270 * turn_of_edge_labels
273 typedef void (dump_graph_func)(ir_graph *);
274 void dump_all_ir_graphs (dump_graph_func *dump_graph);
276 /****m* irdump/turn_off_edge_labels
279 * turn_off_edge_labels
281 * void turn_off_edge_labels();
283 * Sets the vcg flag "display_edge_labels" to no. This is necessary
284 * as xvcg and aisee both fail to display graphs with self-edges if these
289 * dumpers will generate vcg flags with a different header.
294 void turn_off_edge_labels();
296 /****m* irdump/dump_consts_local
301 * void dump_consts_local(bool b);
303 * If set to true constants will be replicated for every use. In non blocked
304 * view edges from constant to block are scipped. Vcg
305 * then layouts the graphs more compact, this makes them better readable.
306 * The flag is automatically and temporarily set to false if other
307 * edges are dumped, as outs, loop, ...
308 * Default setting: false.
315 void dump_consts_local(bool b);
318 /****m* irdump/turn_off_constant_entity_values
321 * turn_off_constant_entity_values
323 * void turn_off_constant_entity_values()
325 * Turns off dumping the values of constant entities. Makes type graphs
334 void turn_off_constant_entity_values();
337 /****m* irdump/dump_keepalive_edges
340 * dump_keepalive_edges
342 * void dump_keepalive_edges()
344 * Turns on dumping the edges from the End node to nodes to be kept
353 void dump_keepalive_edges(bool b);
356 /****m* irdump/dump_out_edges
361 * void dump_out_edges()
363 * Turns on dumping the out edges starting from the Start block in
364 * dump_ir_graph. To test the consistency of the out datastructure.
372 void dump_out_edges();
375 /****m* irdump/dump_dominator_information
378 * dump_dominator_information
380 * void dump_dominator_information()
382 * If this flag is set the dumper dumps edges to immediate dominator in cfg.
390 void dump_dominator_information();
393 /****m* irdump/dump_loop_information
396 * dump_loop_information
398 * void dump_loop_information()
400 * If this flag is set the dumper dumps loop nodes and edges from
401 * these nodes to the contained ir nodes.
402 * Can be turned off with dont_dump_loop_information().
403 * If the loops are interprocedural nodes can be missing.
411 void dump_loop_information();
412 void dont_dump_loop_information();
414 # endif /* _IRDUMP_H_ */