fixed comments for doxygen
[libfirm] / ir / ir / irdump.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 * All rights reserved.
3 *
4 * Authors: Martin Trapp, Christian Schaefer
5 *
6 * dump an ir graph, for further use with xvcg
7 */
8
9 /* $Id$ */
10
11 # ifndef _IRDUMP_H_
12 # define _IRDUMP_H_
13
14 # include "irnode.h"
15 # include "irgraph.h"
16
17 /**
18  *
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.
26  *
27  *   Most routines use the name of the passed entity as the name of the
28  *   file dumped to.
29  *
30  */
31
32 /* @@@ GL: A hack */
33 extern char *dump_file_suffix;
34
35 /**
36  *
37  *   - dump a firm graph
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
46  * @see
47  */
48 void dump_ir_graph (ir_graph *irg);
49
50 /**
51  *
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
61  * @see
62  */
63 void dump_ir_block_graph (ir_graph *irg);
64
65 /**
66  *
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
75  * @see
76  */
77 void dump_cfg (ir_graph *irg);
78
79 /**
80  *
81  *   -
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
89  * @see
90  */
91 void dump_type_graph (ir_graph *irg);
92
93 /**
94  *
95  *   - Dumps all type information
96  *   Dumps all type information that is somehow reachable in standard vcg
97  *   format.
98  *   Dumps the graph to a file named All_types.vcg.
99  *   @param No inputs.
100  *   @return A file containing all type information for the program in standard
101  *   @return vcg format.
102  * @see turn_of_edge_labels
103  * @see
104  */
105 void dump_all_types (void);
106
107 /**
108  *
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.
119  * @see
120  * @see
121  */
122 void dump_class_hierarchy (bool entities);
123
124 /**
125  *
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
135  * @see
136  */
137
138 void dump_ir_graph_w_types (ir_graph *irg);
139 /**
140  *
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
150  * @see
151  */
152 void dump_ir_block_graph_w_types (ir_graph *irg);
153
154
155
156 /**
157  *
158  *   dump_cg_graph
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.
162  * @see
163  */
164 void dump_cg_graph(ir_graph * irg);
165
166 /**
167  *
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.
172  * @see
173  */
174 void dump_cg_block_graph(ir_graph * irg);
175
176
177 void dump_all_cg_block_graph();
178
179 /**
180  *
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:
184  *   dump_ir_graph
185  *   dump_ir_block_graph
186  *   dump_cfg
187  *   dump_type_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
192  * @see
193  */
194 typedef void (dump_graph_func)(ir_graph *);
195 void dump_all_ir_graphs (dump_graph_func *dump_graph);
196
197 /**
198  *
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
202  *   edges have labes.
203  *   @param No inputs
204  *   @return dumpers will generate vcg flags with a different header.
205  * @see
206  * @see
207  */
208 void turn_off_edge_labels();
209
210 /**
211  *
212  *   dump_consts_local
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.
219  * @see
220  * @see
221  */
222 void dump_consts_local(bool b);
223
224
225 /**
226  *
227  *   turn_off_constant_entity_values
228  *   Turns off dumping the values of constant entities. Makes type graphs
229  *   better readable.
230  *   @param No inputs
231  * @see
232  * @see
233  */
234 void turn_off_constant_entity_values();
235
236
237 /**
238  *
239  *   dump_keepalive_edges
240  *   Turns on dumping the edges from the End node to nodes to be kept
241  *   alive
242  *   @param No inputs
243  * @see
244  * @see
245  */
246 void dump_keepalive_edges(bool b);
247
248
249 /**
250  *
251  *   dump_out_edges
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.
254  *   @param No inputs
255  * @see
256  * @see
257  */
258 void dump_out_edges();
259
260
261 /**
262  *
263  *   dump_dominator_information
264  *   If this flag is set the dumper dumps edges to immediate dominator in cfg.
265  *   @param No inputs
266  * @see
267  * @see
268  */
269 void dump_dominator_information();
270
271
272 /**
273  *
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.
279  *   @param No inputs
280  * @see
281  * @see
282  */
283 void dump_loop_information();
284 void dont_dump_loop_information();
285
286 # endif /* _IRDUMP_H_ */