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 http://www.absint.de/aisee/download/index.htm.
28 * Most routines use the name of the passed entity as the name of the
35 /* The following routines use a global variable that is not external.
36 Therefore removed from interface. */
37 /* dump a simple node */
38 void dump_ir_node (ir_node *node);
39 /* dump the edge to the block this node belongs to */
40 void dump_ir_block_edge(ir_node *n);
41 /* dump edges to our inputs */
42 void dump_ir_data_edges(ir_node *n);
45 extern char *dump_file_suffix;
47 /****m* irdump/dump_ir_graph
50 * dump_ir_graph -- dump a firm graph
52 * void dump_ir_graph (ir_graph *irg);
54 * Dumps all Firm nodes of a single graph for a single procedure in
55 * standard xvcg format.
56 * Dumps the graph to a file. The file name is constructed from the
57 * name of the entity describing the procedure (irg->entity) and the
58 * ending .vcg. Eventually overwrites existing files.
60 * irg: The firm graph to be dumped.
62 * A file containing the firm graph in vcg format.
67 void dump_ir_graph (ir_graph *irg);
69 /****m* irdump/dump_ir_block_graph
72 * dump_ir_block_graph -- dump a firm graph without explicit block nodes.
74 * void dump_ir_block_graph (ir_graph *irg);
76 * Dumps all Firm nodes of a single graph for a single procedure in
77 * extended xvcg format.
78 * Dumps the graph to a file. The file name is constructed from the
79 * name of the entity describing the procedure (irg->entity) and the
80 * ending .vcg. Eventually overwrites existing files.
82 * irg: The firm graph to be dumped.
84 * A file containing the firm graph in vcg format.
89 void dump_ir_block_graph (ir_graph *irg);
91 /****m* irdump/dump_cfg
94 * dump_cfg -- Dump the control flow graph of a procedure
96 * void dump_cfg (ir_graph *irg);
98 * Dumps the control flow graph of a procedure in standard xvcg format.
99 * Dumps the graph to a file. The file name is constructed from the
100 * name of the entity describing the procedure (irg->entity) and the
101 * ending -cfg.vcg. Eventually overwrites existing files.
103 * irg: The firm graph whose CFG shall be dumped.
105 * A file containing the CFG in vcg format.
107 * turn_of_edge_labels
110 void dump_cfg (ir_graph *irg);
112 /****m* irdump/dump_type_graph
117 * void dump_type_graph (ir_graph *irg);
119 * Dumps all the type information needed for Calls, Sels, ... in this graph.
120 * Dumps this graph to a file. The file name is constructed from the
121 * name of the entity describing the procedure (irg->entity) and the
122 * ending -type.vcg. Eventually overwrites existing files.
124 * irg: The firm graph whose type information is to be dumped.
126 * A file containing the type information of the firm graph in vcg format.
128 * turn_of_edge_labels
131 void dump_type_graph (ir_graph *irg);
133 /****m* irdump/dump_all_types
136 * dump_all_types -- Dumps all type information
138 * void dump_all_types (void);
140 * Dumps all type information that is somehow reachable in standard vcg
142 * Dumps the graph to a file named All_types.vcg.
146 * A file containing all type information for the program in standard
149 * turn_of_edge_labels
152 void dump_all_types (void);
154 /****m* irdump/dump_ir_graph_w_types
157 * dump_ir_graph_w_types
159 * void dump_ir_graph_w_types (ir_graph *irg);
161 * Dumps a firm graph and all the type information needed for Calls,
162 * Sels, ... in this graph.
163 * Dumps the graph to a file. The file name is constructed from the
164 * name of the entity describing the procedure (irg->entity) and the
165 * ending -all.vcg. Eventually overwrites existing files.
167 * irg: The firm graph to be dumped with its type information.
169 * A file containing the firm graph and the type information of the firm graph in vcg format.
171 * turn_of_edge_labels
175 void dump_ir_graph_w_types (ir_graph *irg);
176 /****m* irdump/dump_ir_block_graph_w_types
179 * dump_ir_block_graph_w_types
181 * void dump_ir_block_graph_w_types (ir_graph *irg);
183 * Dumps a firm graph and all the type information needed for Calls,
184 * Sels, ... in this graph. The graph is in blocked format.
185 * Dumps the graph to a file. The file name is constructed from the
186 * name of the entity describing the procedure (irg->entity) and the
187 * ending -all.vcg. Eventually overwrites existing files.
189 * irg: The firm graph to be dumped with its type information.
191 * A file containing the firm graph and the type information of the firm graph in vcg format.
193 * turn_of_edge_labels
196 void dump_ir_block_graph_w_types (ir_graph *irg);
198 /****m* irdump/dump_all_ir_graphs
201 * dump_all_ir_graphs -- a walker that calls a dumper for each graph
203 * void dump_all_ir_graphs (void dump_graph(ir_graph*));
205 * Walks over all firm graphs and calls a dumper for each graph.
206 * The following dumpers can be passed as arguments:
208 * dump_ir_block_graph
211 * dump_ir_graph_w_types
213 * The dumper to be used for dumping.
215 * Whatever the dumper creates.
217 * turn_of_edge_labels
220 void dump_all_ir_graphs (void dump_graph(ir_graph*));
222 /****m* irdump/turn_off_edge_labels
225 * turn_off_edge_labels
227 * void turn_off_edge_labels();
229 * Sets the vcg flag "display_edge_labels" to no. This is necessary
230 * as xvcg and aisee both fail to display graphs with self-edges if these
235 * dumpers will generate vcg flags with a different header.
240 void turn_off_edge_labels();
243 /****m* irdump/turn_off_constant_entity_values
246 * turn_off_constant_entity_values
248 * void turn_off_constant_entity_values()
250 * Turns off dumping the values of constant entities. Makes type graphs
259 void turn_off_constant_entity_values();
262 /****m* irdump/dump_keepalive_edges
265 * dump_keepalive_edges
267 * void dump_keepalive_edges()
269 * Turns on dumping the edges from the End node to nodes to be kept
278 void dump_keepalive_edges();
281 /****m* irdump/dump_out_edges
286 * void dump_out_edges()
288 * Turns on dumping the out edges starting from the Start block in
289 * dump_ir_graph. To test the consistency of the out datastructure.
297 void dump_out_edges();
300 /****m* irdump/dump_dominator_information
303 * dump_dominator_information
305 * void dump_dominator_information()
307 * If this flag is set the dumper dumps edges to immediate dominator in cfg.
315 void dump_dominator_information();
318 # endif /* _IRDUMP_H_ */