1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
8 * Dump routines for the ir graph and all type information.
10 * @author Martin Trapp, Christian Schaefer
12 * The dump format of most functions is vcg. This is a text based graph
13 * representation. Some use the original format,
14 * but most generate an extended format that is only read by some special
15 * versions of xvcg or by the comercialized version now calles aiSee.
16 * A test version of aiSee is available at
17 * http://www.absint.de/aisee/download/index.htm.
19 * Most routines use the name of the passed entity as the name of the
32 * The value of this string will be added to the file name before .vcg
36 extern char *dump_file_suffix;
41 * @param irg The firm graph to be dumped.
44 * A file containing the firm graph in vcg format.
46 * Dumps all Firm nodes of a single graph for a single procedure in
47 * standard xvcg format.
48 * Dumps the graph to a file. The file name is constructed from the
49 * name of the entity describing the procedure (irg->entity) and the
50 * ending .vcg. Eventually overwrites existing files.
52 * @see turn_of_edge_labels()
54 void dump_ir_graph (ir_graph *irg);
57 * Dump a firm graph without explicit block nodes.
59 * @param irg The firm graph to be dumped.
62 * A file containing the firm graph in vcg format.
64 * Dumps all Firm nodes of a single graph for a single procedure in
65 * extended xvcg format.
66 * Dumps the graph to a file. The file name is constructed from the
67 * name of the entity describing the procedure (irg->entity) and the
68 * ending .vcg. Eventually overwrites existing files.
70 * @see turn_of_edge_labels()
72 void dump_ir_block_graph (ir_graph *irg);
75 * Dump the control flow graph of a procedure.
77 * @param irg The firm graph whose CFG shall be dumped.
80 * A file containing the CFG in vcg format.
82 * Dumps the control flow graph of a procedure in standard xvcg format.
83 * Dumps the graph to a file. The file name is constructed from the
84 * name of the entity describing the procedure (irg->entity) and the
85 * ending -cfg.vcg. Eventually overwrites existing files.
87 * @see turn_of_edge_labels()
89 void dump_cfg (ir_graph *irg);
92 * Dumps all the type information needed for Calls, Sels, ... in this graph.
94 * @param irg The firm graph whose type information is to be dumped.
96 * A file containing the type information of the firm graph in vcg format.
98 * Dumps this graph to a file. The file name is constructed from the
99 * name of the entity describing the procedure (irg->entity) and the
100 * ending -type.vcg. Eventually overwrites existing files.
102 * @see turn_of_edge_labels()
104 void dump_type_graph (ir_graph *irg);
107 * Dumps all type information.
110 * A file containing all type information for the program in standard
113 * Dumps all type information that is somehow reachable in standard vcg
115 * Dumps the graph to a file named All_types.vcg.
117 * @see turn_of_edge_labels()
119 void dump_all_types (void);
122 * Dumps the class hierarchy with or without entities.
124 * @param entities Flag whether to dump the entities.
127 * A file containing the class hierarchy tree for the program in standard
130 * Does not dump the global type.
131 * Dumps a node for all classes and the sub/supertype relations. If
132 * entities is set to true also dumps the entities of classes, but without
133 * any additional information as the entities type. The overwrites relation
134 * is dumped along with the entities.
135 * Dumps to a file class_hierarchy.vcg
137 void dump_class_hierarchy (bool entities);
140 * Dumps a firm graph and all the type information needed for Calls,
141 * Sels, ... in this graph.
143 * @param irg The firm graph to be dumped with its type information.
146 * A file containing the firm graph and the type information of the firm graph in vcg format.
148 * Dumps the graph to a file. The file name is constructed from the
149 * name of the entity describing the procedure (irg->entity) and the
150 * ending -all.vcg. Eventually overwrites existing files.
152 * @see turn_of_edge_labels()
154 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.
160 * @param irg The firm graph to be dumped with its type information.
163 * A file containing the firm graph and the type information of the firm graph in vcg format.
165 * The graph is in blocked format.
166 * Dumps the graph to a file. The file name is constructed from the
167 * name of the entity describing the procedure (irg->entity) and the
168 * ending -all.vcg. Eventually overwrites existing files.
170 * @see turn_of_edge_labels()
172 void dump_ir_block_graph_w_types (ir_graph *irg);
175 * Dumps a interprocedural firm graph as dump_ir_graph.
177 * @param irg The firm graph to be dumped.
180 * A file containing the firm graph in vcg format.
182 void dump_cg_graph(ir_graph * irg);
185 * Dumps a interprocedural firm graph as dump_ir_block_graph.
187 * @param irg The firm graph to be dumped.
190 * A file containing the firm graph in vcg format.
192 void dump_cg_block_graph(ir_graph * irg);
195 void dump_all_cg_block_graph(void);
198 * The type of a walker function that is called for each graph.
200 * @param irg current visited graph
202 typedef void dump_graph_func(ir_graph *irg);
205 * A walker that calls a dumper for each graph.
207 * @param dump_graph The dumper to be used for dumping.
210 * Whatever the dumper creates.
212 * Walks over all firm graphs and calls a dumper for each graph.
213 * The following dumpers can be passed as arguments:
215 * - dump_ir_block_graph()
217 * - dump_type_graph()
218 * - dump_ir_graph_w_types()
220 * @see turn_of_edge_labels()
222 void dump_all_ir_graphs (dump_graph_func *dump_graph);
225 * Sets the vcg flag "display_edge_labels" to no.
228 * as xvcg and aisee both fail to display graphs with self-edges if these
230 * Dumpers will generate vcg flags with a different header.
232 void turn_off_edge_labels(void);
235 * If set to true constants will be replicated for every use. In non blocked
236 * view edges from constant to block are scipped. Vcg
237 * then layouts the graphs more compact, this makes them better readable.
238 * The flag is automatically and temporarily set to false if other
239 * edges are dumped, as outs, loop, ...
240 * Default setting: false.
242 void dump_consts_local(bool b);
245 * Turns off dumping the values of constant entities. Makes type graphs
248 void turn_off_constant_entity_values(void);
251 * Turns on dumping the edges from the End node to nodes to be kept
254 void dump_keepalive_edges(bool b);
257 * Turns on dumping the out edges starting from the Start block in
258 * dump_ir_graph. To test the consistency of the out datastructure.
260 void dump_out_edges(void);
263 * If this flag is set the dumper dumps edges to immediate dominator in cfg.
265 void dump_dominator_information(void);
268 * If this flag is set the dumper dumps loop nodes and edges from
269 * these nodes to the contained ir nodes.
270 * Can be turned off with dont_dump_loop_information().
271 * If the loops are interprocedural nodes can be missing.
273 void dump_loop_information(void);
276 * @see dump_loop_information()
278 void dont_dump_loop_information(void);
280 # endif /* _IRDUMP_H_ */