minor changes to help with making the ajacs-jikes backend
[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 http://www.absint.de/aisee/download/index.htm.
27  *
28  *   Most routines use the name of the passed entity as the name of the
29  *   file dumped to.
30  *
31  ******
32  */
33
34 #if 0
35 /* The following routines use a global variable that is not external.
36    Therefore removed from interface. */
37 /* dump a simple node */
38 void dump_ir_node (ir_node *node);
39 /* dump the edge to the block this node belongs to */
40 void dump_ir_block_edge(ir_node *n);
41 /* dump edges to our inputs */
42 void dump_ir_data_edges(ir_node *n);
43 #endif
44
45 /****m* irdump/dump_ir_graph
46  *
47  * NAME
48  *   dump_ir_graph  -- dump a firm graph
49  * SYNOPSIS
50  *  void dump_ir_graph (ir_graph *irg);
51  * FUNCTION
52  *  Dumps all Firm nodes of a single graph for a single procedure in
53  *  standard xvcg format.
54  *  Dumps the graph to a file.  The file name is constructed from the
55  *  name of the entity describing the procedure (irg->entity) and the
56  *  ending .vcg.  Eventually overwrites existing files.
57  * INPUTS
58  *   irg: The firm graph to be dumped.
59  * RESULT
60  *   A file containing the firm graph in vcg format.
61  * SEE ALSO
62  *  turn_of_edge_labels
63  ***
64  */
65 void dump_ir_graph (ir_graph *irg);
66
67 /****m* irdump/dump_ir_block_graph
68  *
69  * NAME
70  *   dump_ir_block_graph -- dump a firm graph without explicit block nodes.
71  * SYNOPSIS
72  *   void dump_ir_block_graph (ir_graph *irg);
73  * FUNCTION
74  *  Dumps all Firm nodes of a single graph for a single procedure in
75  *  extended xvcg format.
76  *  Dumps the graph to a file.  The file name is constructed from the
77  *  name of the entity describing the procedure (irg->entity) and the
78  *  ending .vcg.  Eventually overwrites existing files.
79  * INPUTS
80  *   irg: The firm graph to be dumped.
81  * RESULT
82  *   A file containing the firm graph in vcg format.
83  * SEE ALSO
84  *  turn_of_edge_labels
85  ***
86  */
87 void dump_ir_block_graph (ir_graph *irg);
88
89 /****m* irdump/dump_cfg
90  *
91  * NAME
92  *   dump_cfg -- Dump the control flow graph of a procedure
93  * SYNOPSIS
94  *   void dump_cfg (ir_graph *irg);
95  * FUNCTION
96  *   Dumps the control flow graph of a procedure in standard xvcg format.
97  *   Dumps the graph to a file.  The file name is constructed from the
98  *   name of the entity describing the procedure (irg->entity) and the
99  *   ending -cfg.vcg.  Eventually overwrites existing files.
100  * INPUTS
101  *   irg: The firm graph whose CFG shall be dumped.
102  * RESULT
103  *   A file containing the CFG in vcg format.
104  * SEE ALSO
105  *  turn_of_edge_labels
106  ***
107  */
108 void dump_cfg (ir_graph *irg);
109
110 /****m* irdump/dump_type_graph
111  *
112  * NAME
113  *   dump_type_graph --
114  * SYNOPSIS
115  *   void dump_type_graph (ir_graph *irg);
116  * FUNCTION
117  *  Dumps all the type information needed for Calls, Sels, ... in this graph.
118  *  Dumps this graph to a file.  The file name is constructed from the
119  *  name of the entity describing the procedure (irg->entity) and the
120  *  ending -type.vcg.  Eventually overwrites existing files.
121  * INPUTS
122  *  irg: The firm graph whose type information is to be dumped.
123  * RESULT
124  *  A file containing the type information of the firm graph in vcg format.
125  * SEE ALSO
126  *  turn_of_edge_labels
127  ***
128  */
129 void dump_type_graph (ir_graph *irg);
130
131 /****m* irdump/dump_all_types
132  *
133  * NAME
134  *   dump_all_types -- Dumps all type information
135  * SYNOPSIS
136  *   void dump_all_types (void);
137  * FUNCTION
138  *   Dumps all type information that is somehow reachable in standard vcg
139  *   format.
140  *   Dumps the graph to a file named All_types.vcg.
141  * INPUTS
142  *   No inputs.
143  * RESULT
144  *   A file containing all type information for the program in standard
145  *   vcg format.
146  * SEE ALSO
147  *  turn_of_edge_labels
148  ***
149  */
150 void dump_all_types (void);
151
152 /****m* irdump/dump_ir_graph_w_types
153  *
154  * NAME
155  *   dump_ir_graph_w_types
156  * SYNOPSIS
157  *   void dump_ir_graph_w_types (ir_graph *irg);
158  * FUNCTION
159  *  Dumps a firm graph and  all the type information needed for Calls,
160  *  Sels, ... in this graph.
161  *  Dumps the graph to a file.  The file name is constructed from the
162  *  name of the entity describing the procedure (irg->entity) and the
163  *  ending -all.vcg.  Eventually overwrites existing files.
164  * INPUTS
165  *   irg: The firm graph to be dumped with its type information.
166  * RESULT
167  *   A file containing the firm graph and the type information of the firm graph in vcg format.
168  * SEE ALSO
169  *  turn_of_edge_labels
170  ***
171  */
172
173 void dump_ir_graph_w_types (ir_graph *irg);
174  /****m* irdump/dump_ir_block_graph_w_types
175  *
176  * NAME
177  *   dump_ir_block_graph_w_types
178  * SYNOPSIS
179  *   void dump_ir_block_graph_w_types (ir_graph *irg);
180  * FUNCTION
181  *  Dumps a firm graph and  all the type information needed for Calls,
182  *  Sels, ... in this graph.  The graph is in blocked format.
183  *  Dumps the graph to a file.  The file name is constructed from the
184  *  name of the entity describing the procedure (irg->entity) and the
185  *  ending -all.vcg.  Eventually overwrites existing files.
186  * INPUTS
187  *   irg: The firm graph to be dumped with its type information.
188  * RESULT
189  *   A file containing the firm graph and the type information of the firm graph in vcg format.
190  * SEE ALSO
191  *  turn_of_edge_labels
192  ***
193  */
194 void dump_ir_block_graph_w_types (ir_graph *irg);
195
196 /****m* irdump/dump_all_ir_graphs
197  *
198  * NAME
199  *   dump_all_ir_graphs -- a walker that calls a dumper for each graph
200  * SYNOPSIS
201  *   void dump_all_ir_graphs (void dump_graph(ir_graph*));
202  * FUNCTION
203  *   Walks over all firm graphs and  calls a dumper for each graph.
204  *   The following dumpers can be passed as arguments:
205  *   dump_ir_graph
206  *   dump_ir_block_graph
207  *   dump_cfg
208  *   dump_type_graph
209  *   dump_ir_graph_w_types
210  * INPUTS
211  *   The dumper to be used for dumping.
212  * RESULT
213  *   Whatever the dumper creates.
214  * SEE ALSO
215  *  turn_of_edge_labels
216  ***
217  */
218 void dump_all_ir_graphs (void dump_graph(ir_graph*));
219
220 /****m* irdump/turn_of_edge_labels
221  *
222  * NAME
223  *   turn_off_edge_labels
224  * SYNOPSIS
225  *   void turn_off_edge_labels();
226  * FUNCTION
227  *   Sets the vcg flag "display_edge_labels" to no.  This is necessary
228  *   as xvcg and aisee both fail to display graphs with self-edges if these
229  *   edges have labes.
230  * INPUTS
231  *   No inputs
232  * RESULT
233  *   dumpers will generate vcg flags with a different header.
234  * SEE ALSO
235  *
236  ***
237  */
238 void turn_off_edge_labels();
239
240
241 /****m* irdump/turn_off_constant_entity_values
242  *
243  * NAME
244  *   turn_off_constant_entity_values
245  * SYNOPSIS
246  *   void turn_off_constant_entity_values()
247  * FUNCTION
248  *   Turns off dumping the values of constant entities. Makes type graphs
249  *   better readable.
250  * INPUTS
251  *   No inputs
252  * RESULT
253  * SEE ALSO
254  *
255  ***
256  */
257 void turn_off_constant_entity_values();
258
259
260 /****m* irdump/dump_keepalive_edges
261  *
262  * NAME
263  *   dump_keepalive_edges
264  * SYNOPSIS
265  *   void dump_keepalive_edges()
266  * FUNCTION
267  *   Turns on dumping the edges from the End node to nodes to be kept
268  *   alive
269  * INPUTS
270  *   No inputs
271  * RESULT
272  * SEE ALSO
273  *
274  ***
275  */
276 void dump_keepalive_edges();
277
278
279 /****m* irdump/dump_constant_entity_values
280  *
281  * NAME
282  *   dump_out_edges
283  * SYNOPSIS
284  *   void dump_out_edges()
285  * FUNCTION
286  *   Turns on dumping the out edges starting from the Start block in
287  *   dump_ir_graph.  To test the consistency of the out datastructure.
288  * INPUTS
289  *   No inputs
290  * RESULT
291  * SEE ALSO
292  *
293  ***
294  */
295 void dump_out_edges();
296 # endif /* _IRDUMP_H_ */