1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
4 * Authors: Martin Trapp, Christian Schaefer
6 * dump an ir graph, for further use with xvcg
19 * - 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
25 * http://www.absint.de/aisee/download/index.htm.
27 * Most routines use the name of the passed entity as the name of the
33 extern char *dump_file_suffix;
38 * Dumps all Firm nodes of a single graph for a single procedure in
39 * standard xvcg format.
40 * Dumps the graph to a file. The file name is constructed from the
41 * name of the entity describing the procedure (irg->entity) and the
42 * ending .vcg. Eventually overwrites existing files.
43 * @param irg: The firm graph to be dumped.
44 * @return A file containing the firm graph in vcg format.
45 * @see turn_of_edge_labels
48 void dump_ir_graph (ir_graph *irg);
52 * - dump a firm graph without explicit block nodes.
53 * Dumps all Firm nodes of a single graph for a single procedure in
54 * extended xvcg format.
55 * Dumps the graph to a file. The file name is constructed from the
56 * name of the entity describing the procedure (irg->entity) and the
57 * ending .vcg. Eventually overwrites existing files.
58 * @param irg: The firm graph to be dumped.
59 * @return A file containing the firm graph in vcg format.
60 * @see turn_of_edge_labels
63 void dump_ir_block_graph (ir_graph *irg);
67 * - Dump the control flow graph of a procedure
68 * Dumps the control flow graph of a procedure in standard xvcg format.
69 * Dumps the graph to a file. The file name is constructed from the
70 * name of the entity describing the procedure (irg->entity) and the
71 * ending -cfg.vcg. Eventually overwrites existing files.
72 * @param irg: The firm graph whose CFG shall be dumped.
73 * @return A file containing the CFG in vcg format.
74 * @see turn_of_edge_labels
77 void dump_cfg (ir_graph *irg);
82 * Dumps all the type information needed for Calls, Sels, ... in this graph.
83 * Dumps this 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 -type.vcg. Eventually overwrites existing files.
86 * @param irg: The firm graph whose type information is to be dumped.
87 * @return A file containing the type information of the firm graph in vcg format.
88 * @see turn_of_edge_labels
91 void dump_type_graph (ir_graph *irg);
95 * - Dumps all type information
96 * Dumps all type information that is somehow reachable in standard vcg
98 * Dumps the graph to a file named All_types.vcg.
100 * @return A file containing all type information for the program in standard
101 * @return vcg format.
102 * @see turn_of_edge_labels
105 void dump_all_types (void);
109 * - Dumps the class hierarchy with or without entities.
110 * Dumps a node for all classes and the sub/supertype relations. If
111 * entities is set to true also dumps the entities of classes, but without
112 * any additional information as the entities type. The overwrites relation
113 * is dumped along with the entities.
114 * Dumps to a file class_hierarchy.vcg
115 * @param Flag whether to dump the entities.
116 * @return A file containing the class hierarchy tree for the program in standard
117 * @return vcg format.
121 void dump_class_hierarchy (bool entities);
125 * dump_ir_graph_w_types
126 * Dumps a firm graph and all the type information needed for Calls,
127 * Sels, ... in this graph.
128 * Dumps the graph to a file. The file name is constructed from the
129 * name of the entity describing the procedure (irg->entity) and the
130 * ending -all.vcg. Eventually overwrites existing files.
131 * @param irg: The firm graph to be dumped with its type information.
132 * @return A file containing the firm graph and the type information of the firm graph in vcg format.
133 * @see turn_of_edge_labels
137 void dump_ir_graph_w_types (ir_graph *irg);
140 * dump_ir_block_graph_w_types
141 * Dumps a firm graph and all the type information needed for Calls,
142 * Sels, ... in this graph. The graph is in blocked format.
143 * Dumps the graph to a file. The file name is constructed from the
144 * name of the entity describing the procedure (irg->entity) and the
145 * ending -all.vcg. Eventually overwrites existing files.
146 * @param irg: The firm graph to be dumped with its type information.
147 * @return A file containing the firm graph and the type information of the firm graph in vcg format.
148 * @see turn_of_edge_labels
151 void dump_ir_block_graph_w_types (ir_graph *irg);
158 * Dumps a interprocedural firm graph as dump_ir_graph.
159 * @param irg: The firm graph to be dumped.
160 * @return A file containing the firm graph in vcg format.
163 void dump_cg_graph(ir_graph * irg);
167 * dump_cg_block_graph
168 * Dumps a interprocedural firm graph as dump_ir_block_graph.
169 * @param irg: The firm graph to be dumped.
170 * @return A file containing the firm graph in vcg format.
173 void dump_cg_block_graph(ir_graph * irg);
176 void dump_all_cg_block_graph();
180 * - a walker that calls a dumper for each graph
181 * Walks over all firm graphs and calls a dumper for each graph.
182 * The following dumpers can be passed as arguments:
184 * dump_ir_block_graph
187 * dump_ir_graph_w_types
188 * @param The dumper to be used for dumping.
189 * @return Whatever the dumper creates.
190 * @see turn_of_edge_labels
193 typedef void (dump_graph_func)(ir_graph *);
194 void dump_all_ir_graphs (dump_graph_func *dump_graph);
198 * turn_off_edge_labels
199 * Sets the vcg flag "display_edge_labels" to no. This is necessary
200 * as xvcg and aisee both fail to display graphs with self-edges if these
203 * @return dumpers will generate vcg flags with a different header.
207 void turn_off_edge_labels();
212 * If set to true constants will be replicated for every use. In non blocked
213 * view edges from constant to block are scipped. Vcg
214 * then layouts the graphs more compact, this makes them better readable.
215 * The flag is automatically and temporarily set to false if other
216 * edges are dumped, as outs, loop, ...
217 * Default setting: false.
221 void dump_consts_local(bool b);
226 * turn_off_constant_entity_values
227 * Turns off dumping the values of constant entities. Makes type graphs
233 void turn_off_constant_entity_values();
238 * dump_keepalive_edges
239 * Turns on dumping the edges from the End node to nodes to be kept
245 void dump_keepalive_edges(bool b);
251 * Turns on dumping the out edges starting from the Start block in
252 * dump_ir_graph. To test the consistency of the out datastructure.
257 void dump_out_edges();
262 * dump_dominator_information
263 * If this flag is set the dumper dumps edges to immediate dominator in cfg.
268 void dump_dominator_information();
273 * dump_loop_information
274 * If this flag is set the dumper dumps loop nodes and edges from
275 * these nodes to the contained ir nodes.
276 * Can be turned off with dont_dump_loop_information().
277 * If the loops are interprocedural nodes can be missing.
282 void dump_loop_information();
283 void dont_dump_loop_information();
285 # endif /* _IRDUMP_H_ */