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 * Does not dump the global type.
111 * Dumps a node for all classes and the sub/supertype relations. If
112 * entities is set to true also dumps the entities of classes, but without
113 * any additional information as the entities type. The overwrites relation
114 * is dumped along with the entities.
115 * Dumps to a file class_hierarchy.vcg
116 * @param Flag whether to dump the entities.
117 * @return A file containing the class hierarchy tree for the program in standard
118 * @return vcg format.
122 void dump_class_hierarchy (bool entities);
126 * dump_ir_graph_w_types
127 * Dumps a firm graph and all the type information needed for Calls,
128 * Sels, ... in this graph.
129 * Dumps the graph to a file. The file name is constructed from the
130 * name of the entity describing the procedure (irg->entity) and the
131 * ending -all.vcg. Eventually overwrites existing files.
132 * @param irg: The firm graph to be dumped with its type information.
133 * @return A file containing the firm graph and the type information of the firm graph in vcg format.
134 * @see turn_of_edge_labels
138 void dump_ir_graph_w_types (ir_graph *irg);
141 * dump_ir_block_graph_w_types
142 * Dumps a firm graph and all the type information needed for Calls,
143 * Sels, ... in this graph. The graph is in blocked format.
144 * Dumps the graph to a file. The file name is constructed from the
145 * name of the entity describing the procedure (irg->entity) and the
146 * ending -all.vcg. Eventually overwrites existing files.
147 * @param irg: The firm graph to be dumped with its type information.
148 * @return A file containing the firm graph and the type information of the firm graph in vcg format.
149 * @see turn_of_edge_labels
152 void dump_ir_block_graph_w_types (ir_graph *irg);
159 * Dumps a interprocedural firm graph as dump_ir_graph.
160 * @param irg: The firm graph to be dumped.
161 * @return A file containing the firm graph in vcg format.
164 void dump_cg_graph(ir_graph * irg);
168 * dump_cg_block_graph
169 * Dumps a interprocedural firm graph as dump_ir_block_graph.
170 * @param irg: The firm graph to be dumped.
171 * @return A file containing the firm graph in vcg format.
174 void dump_cg_block_graph(ir_graph * irg);
177 void dump_all_cg_block_graph();
181 * - a walker that calls a dumper for each graph
182 * Walks over all firm graphs and calls a dumper for each graph.
183 * The following dumpers can be passed as arguments:
185 * dump_ir_block_graph
188 * dump_ir_graph_w_types
189 * @param The dumper to be used for dumping.
190 * @return Whatever the dumper creates.
191 * @see turn_of_edge_labels
194 typedef void (dump_graph_func)(ir_graph *);
195 void dump_all_ir_graphs (dump_graph_func *dump_graph);
199 * turn_off_edge_labels
200 * Sets the vcg flag "display_edge_labels" to no. This is necessary
201 * as xvcg and aisee both fail to display graphs with self-edges if these
204 * @return dumpers will generate vcg flags with a different header.
208 void turn_off_edge_labels();
213 * If set to true constants will be replicated for every use. In non blocked
214 * view edges from constant to block are scipped. Vcg
215 * then layouts the graphs more compact, this makes them better readable.
216 * The flag is automatically and temporarily set to false if other
217 * edges are dumped, as outs, loop, ...
218 * Default setting: false.
222 void dump_consts_local(bool b);
227 * turn_off_constant_entity_values
228 * Turns off dumping the values of constant entities. Makes type graphs
234 void turn_off_constant_entity_values();
239 * dump_keepalive_edges
240 * Turns on dumping the edges from the End node to nodes to be kept
246 void dump_keepalive_edges(bool b);
252 * Turns on dumping the out edges starting from the Start block in
253 * dump_ir_graph. To test the consistency of the out datastructure.
258 void dump_out_edges();
263 * dump_dominator_information
264 * If this flag is set the dumper dumps edges to immediate dominator in cfg.
269 void dump_dominator_information();
274 * dump_loop_information
275 * If this flag is set the dumper dumps loop nodes and edges from
276 * these nodes to the contained ir nodes.
277 * Can be turned off with dont_dump_loop_information().
278 * If the loops are interprocedural nodes can be missing.
283 void dump_loop_information();
284 void dont_dump_loop_information();
286 # endif /* _IRDUMP_H_ */