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
15 /****h* libfirm/irdump
18 * irdump -- dump routines for the graph and all type information
20 * The dump format of most functions is vcg. This is a text based graph
21 * representation. Some use the original format,
22 * but most generate an extended format that is only read by some special
23 * versions of xvcg or by the comercialized version now calles aiSee.
24 * A test version of aiSee is available at http://www.absint.de/aisee/download/index.htm.
26 * Most routines use the name of the passed entity as the name of the
33 /* The following routines use a global variable that is not external.
34 Therefore removed from interface. */
35 /* dump a simple node */
36 void dump_ir_node (ir_node *node);
37 /* dump the edge to the block this node belongs to */
38 void dump_ir_block_edge(ir_node *n);
39 /* dump edges to our inputs */
40 void dump_ir_data_edges(ir_node *n);
43 /****m* irdump/dump_ir_graph
46 * dump_ir_graph -- dump a firm graph
48 * void dump_ir_graph (ir_graph *irg);
50 * Dumps all Firm nodes of a single graph for a single procedure in
51 * standard xvcg format.
52 * Dumps the graph to a file. The file name is constructed from the
53 * name of the entity describing the procedure (irg->entity) and the
54 * ending .vcg. Eventually overwrites existing files.
56 * irg: The firm graph to be dumped.
58 * A file containing the firm graph in vcg format.
63 void dump_ir_graph (ir_graph *irg);
65 /****m* irdump/dump_ir_block_graph
68 * dump_ir_block_graph -- dump a firm graph without explicit block nodes.
70 * void dump_ir_block_graph (ir_graph *irg);
72 * Dumps all Firm nodes of a single graph for a single procedure in
73 * extended xvcg format.
74 * Dumps the graph to a file. The file name is constructed from the
75 * name of the entity describing the procedure (irg->entity) and the
76 * ending .vcg. Eventually overwrites existing files.
78 * irg: The firm graph to be dumped.
80 * A file containing the firm graph in vcg format.
85 void dump_ir_block_graph (ir_graph *irg);
87 /****m* irdump/dump_cfg
90 * dump_cfg -- Dump the control flow graph of a procedure
92 * void dump_cfg (ir_graph *irg);
94 * Dumps the control flow graph of a procedure in standard xvcg format.
95 * Dumps the graph to a file. The file name is constructed from the
96 * name of the entity describing the procedure (irg->entity) and the
97 * ending -cfg.vcg. Eventually overwrites existing files.
99 * irg: The firm graph whose CFG shall be dumped.
101 * A file containing the CFG in vcg format.
103 * turn_of_edge_labels
106 void dump_cfg (ir_graph *irg);
108 /****m* irdump/dump_type_graph
113 * void dump_type_graph (ir_graph *irg);
115 * Dumps all the type information needed for Calls, Sels, ... in this graph.
116 * Dumps this graph to a file. The file name is constructed from the
117 * name of the entity describing the procedure (irg->entity) and the
118 * ending -type.vcg. Eventually overwrites existing files.
120 * irg: The firm graph whose type information is to be dumped.
122 * A file containing the type information of the firm graph in vcg format.
124 * turn_of_edge_labels
127 void dump_type_graph (ir_graph *irg);
129 /****m* irdump/dump_all_types
132 * dump_all_types -- Dumps all type information
134 * void dump_all_types (void);
136 * Dumps all type information that is somehow reachable in standard vcg
138 * Dumps the graph to a file named All_types.vcg.
142 * A file containing all type information for the program in standard
145 * turn_of_edge_labels
148 void dump_all_types (void);
150 /****m* irdump/dump_ir_graph_w_types
153 * dump_ir_graph_w_types
155 * void dump_ir_graph_w_types (ir_graph *irg);
157 * Dumps a firm graph and all the type information needed for Calls,
158 * Sels, ... in this graph.
159 * Dumps the graph to a file. The file name is constructed from the
160 * name of the entity describing the procedure (irg->entity) and the
161 * ending -all.vcg. Eventually overwrites existing files.
163 * irg: The firm graph to be dumped with its type information.
165 * A file containing the firm graph and the type information of the firm graph in vcg format.
167 * turn_of_edge_labels
171 void dump_ir_graph_w_types (ir_graph *irg);
172 /****m* irdump/dump_ir_block_graph_w_types
175 * dump_ir_block_graph_w_types
177 * void dump_ir_block_graph_w_types (ir_graph *irg);
179 * Dumps a firm graph and all the type information needed for Calls,
180 * Sels, ... in this graph. The graph is in blocked format.
181 * Dumps the graph to a file. The file name is constructed from the
182 * name of the entity describing the procedure (irg->entity) and the
183 * ending -all.vcg. Eventually overwrites existing files.
185 * irg: The firm graph to be dumped with its type information.
187 * A file containing the firm graph and the type information of the firm graph in vcg format.
189 * turn_of_edge_labels
192 void dump_ir_block_graph_w_types (ir_graph *irg);
194 /****m* irdump/dump_all_ir_graphs
197 * dump_all_ir_graphs -- a walker that calls a dumper for each graph
199 * void dump_all_ir_graphs (void dump_graph(ir_graph*));
201 * Walks over all firm graphs and calls a dumper for each graph.
202 * The following dumpers can be passed as arguments:
204 * dump_ir_block_graph
207 * dump_ir_graph_w_types
209 * The dumper to be used for dumping.
211 * Whatever the dumper creates.
213 * turn_of_edge_labels
216 void dump_all_ir_graphs (void dump_graph(ir_graph*));
218 /****m* irdump/turn_of_edge_labels
221 * turn_of_edge_labels
223 * void turn_of_edge_labels();
225 * Sets the vcg flag "display_edge_labels" to no. This is necessary
226 * as xvcg and aisee both fail to display graphs with self-edges if these
231 * dumpers will generate vcg flags with a different header.
236 void turn_of_edge_labels();
239 # endif /* _IRDUMP_H_ */