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 /* The following routines use a global variable that is not external.
37 Therefore removed from interface. */
38 /* dump a simple node */
39 void dump_ir_node (ir_node *node);
40 /* dump the edge to the block this node belongs to */
41 void dump_ir_block_edge(ir_node *n);
42 /* dump edges to our inputs */
43 void dump_ir_data_edges(ir_node *n);
46 extern char *dump_file_suffix;
48 /****m* irdump/dump_ir_graph
51 * dump_ir_graph -- dump a firm graph
53 * void dump_ir_graph (ir_graph *irg);
55 * Dumps all Firm nodes of a single graph for a single procedure in
56 * standard xvcg format.
57 * Dumps the graph to a file. The file name is constructed from the
58 * name of the entity describing the procedure (irg->entity) and the
59 * ending .vcg. Eventually overwrites existing files.
61 * irg: The firm graph to be dumped.
63 * A file containing the firm graph in vcg format.
68 void dump_ir_graph (ir_graph *irg);
70 /****m* irdump/dump_ir_block_graph
73 * dump_ir_block_graph -- dump a firm graph without explicit block nodes.
75 * void dump_ir_block_graph (ir_graph *irg);
77 * Dumps all Firm nodes of a single graph for a single procedure in
78 * extended xvcg format.
79 * Dumps the graph to a file. The file name is constructed from the
80 * name of the entity describing the procedure (irg->entity) and the
81 * ending .vcg. Eventually overwrites existing files.
83 * irg: The firm graph to be dumped.
85 * A file containing the firm graph in vcg format.
90 void dump_ir_block_graph (ir_graph *irg);
92 /****m* irdump/dump_cfg
95 * dump_cfg -- Dump the control flow graph of a procedure
97 * void dump_cfg (ir_graph *irg);
99 * Dumps the control flow graph of a procedure in standard xvcg format.
100 * Dumps the graph to a file. The file name is constructed from the
101 * name of the entity describing the procedure (irg->entity) and the
102 * ending -cfg.vcg. Eventually overwrites existing files.
104 * irg: The firm graph whose CFG shall be dumped.
106 * A file containing the CFG in vcg format.
108 * turn_of_edge_labels
111 void dump_cfg (ir_graph *irg);
113 /****m* irdump/dump_type_graph
118 * void dump_type_graph (ir_graph *irg);
120 * Dumps all the type information needed for Calls, Sels, ... in this graph.
121 * Dumps this graph to a file. The file name is constructed from the
122 * name of the entity describing the procedure (irg->entity) and the
123 * ending -type.vcg. Eventually overwrites existing files.
125 * irg: The firm graph whose type information is to be dumped.
127 * A file containing the type information of the firm graph in vcg format.
129 * turn_of_edge_labels
132 void dump_type_graph (ir_graph *irg);
134 /****m* irdump/dump_all_types
137 * dump_all_types -- Dumps all type information
139 * void dump_all_types (void);
141 * Dumps all type information that is somehow reachable in standard vcg
143 * Dumps the graph to a file named All_types.vcg.
147 * A file containing all type information for the program in standard
150 * turn_of_edge_labels
153 void dump_all_types (void);
155 /****m* irdump/dump_ir_graph_w_types
158 * dump_ir_graph_w_types
160 * void dump_ir_graph_w_types (ir_graph *irg);
162 * Dumps a firm graph and all the type information needed for Calls,
163 * Sels, ... in this graph.
164 * Dumps the graph to a file. The file name is constructed from the
165 * name of the entity describing the procedure (irg->entity) and the
166 * ending -all.vcg. Eventually overwrites existing files.
168 * irg: The firm graph to be dumped with its type information.
170 * A file containing the firm graph and the type information of the firm graph in vcg format.
172 * turn_of_edge_labels
176 void dump_ir_graph_w_types (ir_graph *irg);
177 /****m* irdump/dump_ir_block_graph_w_types
180 * dump_ir_block_graph_w_types
182 * void dump_ir_block_graph_w_types (ir_graph *irg);
184 * Dumps a firm graph and all the type information needed for Calls,
185 * Sels, ... in this graph. The graph is in blocked format.
186 * Dumps the graph to a file. The file name is constructed from the
187 * name of the entity describing the procedure (irg->entity) and the
188 * ending -all.vcg. Eventually overwrites existing files.
190 * irg: The firm graph to be dumped with its type information.
192 * A file containing the firm graph and the type information of the firm graph in vcg format.
194 * turn_of_edge_labels
197 void dump_ir_block_graph_w_types (ir_graph *irg);
201 /****m* irdump/dump_cg_graph
206 * void dump_cg_graph (ir_graph *irg);
208 * Dumps a interprocedural firm graph as dump_ir_graph.
210 * irg: The firm graph to be dumped.
212 * A file containing the firm graph in vcg format.
216 void dump_cg_graph(ir_graph * irg);
218 /****m* irdump/dump_cg_block_graph
221 * dump_cg_block_graph
223 * void dump_cg_block_graph (ir_graph *irg);
225 * Dumps a interprocedural firm graph as dump_ir_block_graph.
227 * irg: The firm graph to be dumped.
229 * A file containing the firm graph in vcg format.
233 void dump_cg_block_graph(ir_graph * irg);
235 /****m* irdump/dump_all_ir_graphs
238 * dump_all_ir_graphs -- a walker that calls a dumper for each graph
240 * void dump_all_ir_graphs (void dump_graph(ir_graph*));
242 * Walks over all firm graphs and calls a dumper for each graph.
243 * The following dumpers can be passed as arguments:
245 * dump_ir_block_graph
248 * dump_ir_graph_w_types
250 * The dumper to be used for dumping.
252 * Whatever the dumper creates.
254 * turn_of_edge_labels
257 void dump_all_ir_graphs (void dump_graph(ir_graph*));
259 /****m* irdump/turn_off_edge_labels
262 * turn_off_edge_labels
264 * void turn_off_edge_labels();
266 * Sets the vcg flag "display_edge_labels" to no. This is necessary
267 * as xvcg and aisee both fail to display graphs with self-edges if these
272 * dumpers will generate vcg flags with a different header.
277 void turn_off_edge_labels();
280 /****m* irdump/turn_off_constant_entity_values
283 * turn_off_constant_entity_values
285 * void turn_off_constant_entity_values()
287 * Turns off dumping the values of constant entities. Makes type graphs
296 void turn_off_constant_entity_values();
299 /****m* irdump/dump_keepalive_edges
302 * dump_keepalive_edges
304 * void dump_keepalive_edges()
306 * Turns on dumping the edges from the End node to nodes to be kept
315 void dump_keepalive_edges();
318 /****m* irdump/dump_out_edges
323 * void dump_out_edges()
325 * Turns on dumping the out edges starting from the Start block in
326 * dump_ir_graph. To test the consistency of the out datastructure.
334 void dump_out_edges();
337 /****m* irdump/dump_dominator_information
340 * dump_dominator_information
342 * void dump_dominator_information()
344 * If this flag is set the dumper dumps edges to immediate dominator in cfg.
352 void dump_dominator_information();
354 void dump_loop_information();
355 void dont_dump_loop_information();
357 # endif /* _IRDUMP_H_ */