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 /****m* irdump/dump_ir_graph
48 * dump_ir_graph -- dump a firm graph
50 * void dump_ir_graph (ir_graph *irg);
52 * Dumps all Firm nodes of a single graph for a single procedure in
53 * standard xvcg format.
54 * Dumps the graph to a file. The file name is constructed from the
55 * name of the entity describing the procedure (irg->entity) and the
56 * ending .vcg. Eventually overwrites existing files.
58 * irg: The firm graph to be dumped.
60 * A file containing the firm graph in vcg format.
65 void dump_ir_graph (ir_graph *irg);
67 /****m* irdump/dump_ir_block_graph
70 * dump_ir_block_graph -- dump a firm graph without explicit block nodes.
72 * void dump_ir_block_graph (ir_graph *irg);
74 * Dumps all Firm nodes of a single graph for a single procedure in
75 * extended xvcg format.
76 * Dumps the graph to a file. The file name is constructed from the
77 * name of the entity describing the procedure (irg->entity) and the
78 * ending .vcg. Eventually overwrites existing files.
80 * irg: The firm graph to be dumped.
82 * A file containing the firm graph in vcg format.
87 void dump_ir_block_graph (ir_graph *irg);
89 /****m* irdump/dump_cfg
92 * dump_cfg -- Dump the control flow graph of a procedure
94 * void dump_cfg (ir_graph *irg);
96 * Dumps the control flow graph of a procedure in standard xvcg format.
97 * Dumps the graph to a file. The file name is constructed from the
98 * name of the entity describing the procedure (irg->entity) and the
99 * ending -cfg.vcg. Eventually overwrites existing files.
101 * irg: The firm graph whose CFG shall be dumped.
103 * A file containing the CFG in vcg format.
105 * turn_of_edge_labels
108 void dump_cfg (ir_graph *irg);
110 /****m* irdump/dump_type_graph
115 * void dump_type_graph (ir_graph *irg);
117 * Dumps all the type information needed for Calls, Sels, ... in this graph.
118 * Dumps this graph to a file. The file name is constructed from the
119 * name of the entity describing the procedure (irg->entity) and the
120 * ending -type.vcg. Eventually overwrites existing files.
122 * irg: The firm graph whose type information is to be dumped.
124 * A file containing the type information of the firm graph in vcg format.
126 * turn_of_edge_labels
129 void dump_type_graph (ir_graph *irg);
131 /****m* irdump/dump_all_types
134 * dump_all_types -- Dumps all type information
136 * void dump_all_types (void);
138 * Dumps all type information that is somehow reachable in standard vcg
140 * Dumps the graph to a file named All_types.vcg.
144 * A file containing all type information for the program in standard
147 * turn_of_edge_labels
150 void dump_all_types (void);
152 /****m* irdump/dump_ir_graph_w_types
155 * dump_ir_graph_w_types
157 * void dump_ir_graph_w_types (ir_graph *irg);
159 * Dumps a firm graph and all the type information needed for Calls,
160 * Sels, ... in this graph.
161 * Dumps the graph to a file. The file name is constructed from the
162 * name of the entity describing the procedure (irg->entity) and the
163 * ending -all.vcg. Eventually overwrites existing files.
165 * irg: The firm graph to be dumped with its type information.
167 * A file containing the firm graph and the type information of the firm graph in vcg format.
169 * turn_of_edge_labels
173 void dump_ir_graph_w_types (ir_graph *irg);
174 /****m* irdump/dump_ir_block_graph_w_types
177 * dump_ir_block_graph_w_types
179 * void dump_ir_block_graph_w_types (ir_graph *irg);
181 * Dumps a firm graph and all the type information needed for Calls,
182 * Sels, ... in this graph. The graph is in blocked format.
183 * Dumps the graph to a file. The file name is constructed from the
184 * name of the entity describing the procedure (irg->entity) and the
185 * ending -all.vcg. Eventually overwrites existing files.
187 * irg: The firm graph to be dumped with its type information.
189 * A file containing the firm graph and the type information of the firm graph in vcg format.
191 * turn_of_edge_labels
194 void dump_ir_block_graph_w_types (ir_graph *irg);
196 /****m* irdump/dump_all_ir_graphs
199 * dump_all_ir_graphs -- a walker that calls a dumper for each graph
201 * void dump_all_ir_graphs (void dump_graph(ir_graph*));
203 * Walks over all firm graphs and calls a dumper for each graph.
204 * The following dumpers can be passed as arguments:
206 * dump_ir_block_graph
209 * dump_ir_graph_w_types
211 * The dumper to be used for dumping.
213 * Whatever the dumper creates.
215 * turn_of_edge_labels
218 void dump_all_ir_graphs (void dump_graph(ir_graph*));
220 /****m* irdump/turn_of_edge_labels
223 * turn_of_edge_labels
225 * void turn_of_edge_labels();
227 * Sets the vcg flag "display_edge_labels" to no. This is necessary
228 * as xvcg and aisee both fail to display graphs with self-edges if these
233 * dumpers will generate vcg flags with a different header.
238 void turn_of_edge_labels();
241 /****m* irdump/dump_constant_entity_values
244 * dump_constant_entity_values
246 * void dump_constant_entity_values()
248 * Turns off dumping the values of constant entities. Makes type graphs
257 void dump_constant_entity_values();
260 /****m* irdump/dump_constant_entity_values
263 * dump_keepalive_edges
265 * void dump_keepalive_edges()
267 * Turns on dumping the edges from the End node to nodes to be kept
276 void dump_keepalive_edges();
279 /****m* irdump/dump_constant_entity_values
284 * void dump_out_edges()
286 * Turns on dumping the out edges starting from the Start block in
287 * dump_ir_graph. To test the consistency of the out datastructure.
295 void dump_out_edges();
296 # endif /* _IRDUMP_H_ */