there is still are problem with the test of compatibility of methods.
[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 /****h* libfirm/irdump
18  *
19  * NAME
20  *   irdump -- dump routines for the graph and all type information
21  * NOTES
22  *   The dump format of most functions is vcg.  This is a text based graph
23  *   representation. Some use the original format,
24  *   but most generate an extended format that is only read by some special
25  *   versions of xvcg or by the comercialized version now calles aiSee.
26  *   A test version of aiSee is available at
27  *   http://www.absint.de/aisee/download/index.htm.
28  *
29  *   Most routines use the name of the passed entity as the name of the
30  *   file dumped to.
31  *
32  ******
33  */
34
35 #if 0
36 /* The following routines use a global variable that is not external.
37    Therefore removed from interface. */
38 /* dump a simple node */
39 void dump_ir_node (ir_node *node);
40 /* dump the edge to the block this node belongs to */
41 void dump_ir_block_edge(ir_node *n);
42 /* dump edges to our inputs */
43 void dump_ir_data_edges(ir_node *n);
44 #endif
45 /* @@@ GL: A hack */
46 extern char *dump_file_suffix;
47
48 /****m* irdump/dump_ir_graph
49  *
50  * NAME
51  *   dump_ir_graph  -- dump a firm graph
52  * SYNOPSIS
53  *  void dump_ir_graph (ir_graph *irg);
54  * FUNCTION
55  *  Dumps all Firm nodes of a single graph for a single procedure in
56  *  standard xvcg format.
57  *  Dumps the graph to a file.  The file name is constructed from the
58  *  name of the entity describing the procedure (irg->entity) and the
59  *  ending .vcg.  Eventually overwrites existing files.
60  * INPUTS
61  *   irg: The firm graph to be dumped.
62  * RESULT
63  *   A file containing the firm graph in vcg format.
64  * SEE ALSO
65  *  turn_of_edge_labels
66  ***
67  */
68 void dump_ir_graph (ir_graph *irg);
69
70 /****m* irdump/dump_ir_block_graph
71  *
72  * NAME
73  *   dump_ir_block_graph -- dump a firm graph without explicit block nodes.
74  * SYNOPSIS
75  *   void dump_ir_block_graph (ir_graph *irg);
76  * FUNCTION
77  *  Dumps all Firm nodes of a single graph for a single procedure in
78  *  extended xvcg format.
79  *  Dumps the graph to a file.  The file name is constructed from the
80  *  name of the entity describing the procedure (irg->entity) and the
81  *  ending .vcg.  Eventually overwrites existing files.
82  * INPUTS
83  *   irg: The firm graph to be dumped.
84  * RESULT
85  *   A file containing the firm graph in vcg format.
86  * SEE ALSO
87  *  turn_of_edge_labels
88  ***
89  */
90 void dump_ir_block_graph (ir_graph *irg);
91
92 /****m* irdump/dump_cfg
93  *
94  * NAME
95  *   dump_cfg -- Dump the control flow graph of a procedure
96  * SYNOPSIS
97  *   void dump_cfg (ir_graph *irg);
98  * FUNCTION
99  *   Dumps the control flow graph of a procedure in standard xvcg format.
100  *   Dumps the graph to a file.  The file name is constructed from the
101  *   name of the entity describing the procedure (irg->entity) and the
102  *   ending -cfg.vcg.  Eventually overwrites existing files.
103  * INPUTS
104  *   irg: The firm graph whose CFG shall be dumped.
105  * RESULT
106  *   A file containing the CFG in vcg format.
107  * SEE ALSO
108  *  turn_of_edge_labels
109  ***
110  */
111 void dump_cfg (ir_graph *irg);
112
113 /****m* irdump/dump_type_graph
114  *
115  * NAME
116  *   dump_type_graph --
117  * SYNOPSIS
118  *   void dump_type_graph (ir_graph *irg);
119  * FUNCTION
120  *  Dumps all the type information needed for Calls, Sels, ... in this graph.
121  *  Dumps this graph to a file.  The file name is constructed from the
122  *  name of the entity describing the procedure (irg->entity) and the
123  *  ending -type.vcg.  Eventually overwrites existing files.
124  * INPUTS
125  *  irg: The firm graph whose type information is to be dumped.
126  * RESULT
127  *  A file containing the type information of the firm graph in vcg format.
128  * SEE ALSO
129  *  turn_of_edge_labels
130  ***
131  */
132 void dump_type_graph (ir_graph *irg);
133
134 /****m* irdump/dump_all_types
135  *
136  * NAME
137  *   dump_all_types -- Dumps all type information
138  * SYNOPSIS
139  *   void dump_all_types (void);
140  * FUNCTION
141  *   Dumps all type information that is somehow reachable in standard vcg
142  *   format.
143  *   Dumps the graph to a file named All_types.vcg.
144  * INPUTS
145  *   No inputs.
146  * RESULT
147  *   A file containing all type information for the program in standard
148  *   vcg format.
149  * SEE ALSO
150  *  turn_of_edge_labels
151  ***
152  */
153 void dump_all_types (void);
154
155 /****m* irdump/dump_ir_graph_w_types
156  *
157  * NAME
158  *   dump_ir_graph_w_types
159  * SYNOPSIS
160  *   void dump_ir_graph_w_types (ir_graph *irg);
161  * FUNCTION
162  *  Dumps a firm graph and  all the type information needed for Calls,
163  *  Sels, ... in this graph.
164  *  Dumps the graph to a file.  The file name is constructed from the
165  *  name of the entity describing the procedure (irg->entity) and the
166  *  ending -all.vcg.  Eventually overwrites existing files.
167  * INPUTS
168  *   irg: The firm graph to be dumped with its type information.
169  * RESULT
170  *   A file containing the firm graph and the type information of the firm graph in vcg format.
171  * SEE ALSO
172  *  turn_of_edge_labels
173  ***
174  */
175
176 void dump_ir_graph_w_types (ir_graph *irg);
177  /****m* irdump/dump_ir_block_graph_w_types
178  *
179  * NAME
180  *   dump_ir_block_graph_w_types
181  * SYNOPSIS
182  *   void dump_ir_block_graph_w_types (ir_graph *irg);
183  * FUNCTION
184  *  Dumps a firm graph and  all the type information needed for Calls,
185  *  Sels, ... in this graph.  The graph is in blocked format.
186  *  Dumps the graph to a file.  The file name is constructed from the
187  *  name of the entity describing the procedure (irg->entity) and the
188  *  ending -all.vcg.  Eventually overwrites existing files.
189  * INPUTS
190  *   irg: The firm graph to be dumped with its type information.
191  * RESULT
192  *   A file containing the firm graph and the type information of the firm graph in vcg format.
193  * SEE ALSO
194  *  turn_of_edge_labels
195  ***
196  */
197 void dump_ir_block_graph_w_types (ir_graph *irg);
198
199
200
201 /****m* irdump/dump_cg_graph
202  *
203  * NAME
204  *   dump_cg_graph
205  * SYNOPSIS
206  *   void dump_cg_graph (ir_graph *irg);
207  * FUNCTION
208  *  Dumps a interprocedural firm graph as dump_ir_graph.
209  * INPUTS
210  *   irg: The firm graph to be dumped.
211  * RESULT
212  *   A file containing the firm graph in vcg format.
213  * SEE ALSO
214  ***
215  */
216 void dump_cg_graph(ir_graph * irg);
217
218 /****m* irdump/dump_cg_block_graph
219  *
220  * NAME
221  *   dump_cg_block_graph
222  * SYNOPSIS
223  *   void dump_cg_block_graph (ir_graph *irg);
224  * FUNCTION
225  *  Dumps a interprocedural firm graph as dump_ir_block_graph.
226  * INPUTS
227  *   irg: The firm graph to be dumped.
228  * RESULT
229  *   A file containing the firm graph in vcg format.
230  * SEE ALSO
231  ***
232  */
233 void dump_cg_block_graph(ir_graph * irg);
234
235 /****m* irdump/dump_all_ir_graphs
236  *
237  * NAME
238  *   dump_all_ir_graphs -- a walker that calls a dumper for each graph
239  * SYNOPSIS
240  *   void dump_all_ir_graphs (void dump_graph(ir_graph*));
241  * FUNCTION
242  *   Walks over all firm graphs and  calls a dumper for each graph.
243  *   The following dumpers can be passed as arguments:
244  *   dump_ir_graph
245  *   dump_ir_block_graph
246  *   dump_cfg
247  *   dump_type_graph
248  *   dump_ir_graph_w_types
249  * INPUTS
250  *   The dumper to be used for dumping.
251  * RESULT
252  *   Whatever the dumper creates.
253  * SEE ALSO
254  *  turn_of_edge_labels
255  ***
256  */
257 void dump_all_ir_graphs (void dump_graph(ir_graph*));
258
259 /****m* irdump/turn_off_edge_labels
260  *
261  * NAME
262  *   turn_off_edge_labels
263  * SYNOPSIS
264  *   void turn_off_edge_labels();
265  * FUNCTION
266  *   Sets the vcg flag "display_edge_labels" to no.  This is necessary
267  *   as xvcg and aisee both fail to display graphs with self-edges if these
268  *   edges have labes.
269  * INPUTS
270  *   No inputs
271  * RESULT
272  *   dumpers will generate vcg flags with a different header.
273  * SEE ALSO
274  *
275  ***
276  */
277 void turn_off_edge_labels();
278
279
280 /****m* irdump/turn_off_constant_entity_values
281  *
282  * NAME
283  *   turn_off_constant_entity_values
284  * SYNOPSIS
285  *   void turn_off_constant_entity_values()
286  * FUNCTION
287  *   Turns off dumping the values of constant entities. Makes type graphs
288  *   better readable.
289  * INPUTS
290  *   No inputs
291  * RESULT
292  * SEE ALSO
293  *
294  ***
295  */
296 void turn_off_constant_entity_values();
297
298
299 /****m* irdump/dump_keepalive_edges
300  *
301  * NAME
302  *   dump_keepalive_edges
303  * SYNOPSIS
304  *   void dump_keepalive_edges()
305  * FUNCTION
306  *   Turns on dumping the edges from the End node to nodes to be kept
307  *   alive
308  * INPUTS
309  *   No inputs
310  * RESULT
311  * SEE ALSO
312  *
313  ***
314  */
315 void dump_keepalive_edges();
316
317
318 /****m* irdump/dump_out_edges
319  *
320  * NAME
321  *   dump_out_edges
322  * SYNOPSIS
323  *   void dump_out_edges()
324  * FUNCTION
325  *   Turns on dumping the out edges starting from the Start block in
326  *   dump_ir_graph.  To test the consistency of the out datastructure.
327  * INPUTS
328  *   No inputs
329  * RESULT
330  * SEE ALSO
331  *
332  ***
333  */
334 void dump_out_edges();
335
336
337 /****m* irdump/dump_dominator_information
338  *
339  * NAME
340  *   dump_dominator_information
341  * SYNOPSIS
342  *   void dump_dominator_information()
343  * FUNCTION
344  *   If this flag is set the dumper dumps edges to immediate dominator in cfg.
345  * INPUTS
346  *   No inputs
347  * RESULT
348  * SEE ALSO
349  *
350  ***
351  */
352 void dump_dominator_information();
353
354
355 # endif /* _IRDUMP_H_ */