3 * File name: ir/ir/irdump.h
4 * Purpose: Write vcg representation of firm to file.
5 * Author: Martin Trapp, Christian Schaefer
6 * Modified by: Goetz Lindenmaier, Hubert Schmidt
9 * Copyright: (c) 1998-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
17 * Dump routines for the ir graph and all type information.
19 * @author Martin Trapp, Christian Schaefer
21 * The dump format of most functions is vcg. This is a text based graph
22 * representation. Some use the original format,
23 * but most generate an extended format that is only read by some special
24 * versions of xvcg or by the comercialized version now calles aiSee.
25 * A test version of aiSee is available at
26 * http://www.absint.de/aisee/download/index.htm.
28 * Most routines use the name of the passed entity as the name of the
40 * The value of this string will be added to the file name before .vcg
42 * @todo GL: A hack -- add parameter to dumper function.
44 extern char *dump_file_suffix;
49 * @param irg The firm graph to be dumped.
52 * A file containing the firm graph in vcg format.
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 * @see turn_off_edge_labels()
62 void dump_ir_graph (ir_graph *irg);
65 * Dump a firm graph without explicit block nodes.
67 * @param irg The firm graph to be dumped.
70 * A file containing the firm graph in vcg format.
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 * @see turn_off_edge_labels()
80 void dump_ir_block_graph (ir_graph *irg);
83 * Dump the control flow graph of a procedure.
85 * @param irg The firm graph whose CFG shall be dumped.
88 * A file containing the CFG in vcg format.
90 * Dumps the control flow graph of a procedure in standard xvcg format.
91 * Dumps the graph to a file. The file name is constructed from the
92 * name of the entity describing the procedure (irg->entity) and the
93 * ending -cfg.vcg. Eventually overwrites existing files.
95 * @see turn_off_edge_labels()
97 void dump_cfg (ir_graph *irg);
100 * Dumps all the type information needed for Calls, Sels, ... in this graph.
102 * @param irg The firm graph whose type information is to be dumped.
104 * A file containing the type information of the firm graph in vcg format.
106 * Dumps this graph to a file. The file name is constructed from the
107 * name of the entity describing the procedure (irg->entity) and the
108 * ending -type.vcg. Eventually overwrites existing files.
110 * @see turn_off_edge_labels()
112 void dump_type_graph (ir_graph *irg);
115 * Dumps all type information.
118 * A file containing all type information for the program in standard
121 * Dumps all type information that is somehow reachable in standard vcg
123 * Dumps the graph to a file named All_types.vcg.
125 * @see turn_off_edge_labels()
127 void dump_all_types (void);
130 * Dumps the class hierarchy with or without entities.
132 * @param entities Flag whether to dump the entities.
135 * A file containing the class hierarchy tree for the program in standard
138 * Does not dump the global type.
139 * Dumps a node for all classes and the sub/supertype relations. If
140 * entities is set to true also dumps the entities of classes, but without
141 * any additional information as the entities type. The overwrites relation
142 * is dumped along with the entities.
143 * Dumps to a file class_hierarchy.vcg
145 void dump_class_hierarchy (bool entities);
148 * Dumps a firm graph and all the type information needed for Calls,
149 * Sels, ... in this graph.
151 * @param irg The firm graph to be dumped with its type information.
154 * A file containing the firm graph and the type information of the firm graph in vcg format.
156 * Dumps the graph to a file. The file name is constructed from the
157 * name of the entity describing the procedure (irg->entity) and the
158 * ending -all.vcg. Eventually overwrites existing files.
160 * @see turn_off_edge_labels()
162 void dump_ir_graph_w_types (ir_graph *irg);
165 * Dumps a firm graph and all the type information needed for Calls,
166 * Sels, ... in this graph.
168 * @param irg The firm graph to be dumped with its type information.
171 * A file containing the firm graph and the type information of the firm graph in vcg format.
173 * The graph is in blocked format.
174 * Dumps the graph to a file. The file name is constructed from the
175 * name of the entity describing the procedure (irg->entity) and the
176 * ending -all.vcg. Eventually overwrites existing files.
178 * @see turn_off_edge_labels()
180 void dump_ir_block_graph_w_types (ir_graph *irg);
183 * Dumps a interprocedural firm graph as dump_ir_graph.
185 * @param irg The firm graph to be dumped.
188 * A file containing the firm graph in vcg format.
190 void dump_cg_graph(ir_graph * irg);
193 * Dumps a interprocedural firm graph as dump_ir_block_graph.
195 * @param irg The firm graph to be dumped.
198 * A file containing the firm graph in vcg format.
200 void dump_cg_block_graph(ir_graph * irg);
203 void dump_all_cg_block_graph(void);
206 * The type of a walker function that is called for each graph.
208 * @param irg current visited graph
210 typedef void dump_graph_func(ir_graph *irg);
213 * A walker that calls a dumper for each graph.
215 * @param dump_graph The dumper to be used for dumping.
218 * Whatever the dumper creates.
220 * Walks over all firm graphs and calls a dumper for each graph.
221 * The following dumpers can be passed as arguments:
223 * - dump_ir_block_graph()
225 * - dump_type_graph()
226 * - dump_ir_graph_w_types()
228 * @see turn_off_edge_labels()
230 void dump_all_ir_graphs (dump_graph_func *dump_graph);
233 * Sets the vcg flag "display_edge_labels" to no.
236 * as xvcg and aisee both fail to display graphs with self-edges if these
238 * Dumpers will generate vcg flags with a different header.
240 void turn_off_edge_labels(void);
243 * If set to true constants will be replicated for every use. In non blocked
244 * view edges from constant to block are scipped. Vcg
245 * then layouts the graphs more compact, this makes them better readable.
246 * The flag is automatically and temporarily set to false if other
247 * edges are dumped, as outs, loop, ...
248 * Default setting: false.
250 void dump_consts_local(bool b);
252 * Returns false if dump_out_edge_flag or dump_loop_information_flag
253 * are set, else returns dump_const_local_flag.
255 bool get_opt_dump_const_local(void);
258 * Turns off dumping the values of constant entities. Makes type graphs
261 void turn_off_constant_entity_values(void);
264 * Turns on dumping the edges from the End node to nodes to be kept
267 void dump_keepalive_edges(bool b);
268 bool get_opt_dump_keepalive_edges(void);
271 * Turns on dumping the out edges starting from the Start block in
272 * dump_ir_graph. To test the consistency of the out datastructure.
274 void dump_out_edges(void);
277 * If this flag is set the dumper dumps edges to immediate dominator in cfg.
279 void dump_dominator_information(void);
282 * If this flag is set the dumper dumps loop nodes and edges from
283 * these nodes to the contained ir nodes.
284 * Can be turned off with dont_dump_loop_information().
285 * If the loops are interprocedural nodes can be missing.
287 void dump_loop_information(void);
290 * @see dump_loop_information()
292 void dont_dump_loop_information(void);
295 * Dump the information of type field specified in ana/irtypeinfo.h.
296 * If the flag is set, the type name is output in [] in the node label,
297 * else it is output as info.
299 void dump_analysed_type_info(bool b);
301 # endif /* _IRDUMP_H_ */