changed bounds of arrays from plain ints to irnode*s.
[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 # ifndef _IRDUMP_H_
10 # define _IRDUMP_H_
11
12 # include "irnode.h"
13 # include "irgraph.h"
14
15 /****h* libfirm/irdump
16  *
17  * NAME
18  *   irdump -- dump routines for the graph and all type information
19  * NOTES
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 http://www.absint.de/aisee/download/index.htm.
25  *
26  *   Most routines use the name of the passed entity as the name of the
27  *   file dumped to.
28  *
29  ******
30  */
31
32 #if 0
33 /* The following routines use a flobal variable that is not external.
34    Therefore removed from interface. */
35 /* dump a simple node */
36 void dump_ir_node (ir_node *node);
37 /* dump the edge to the block this node belongs to */
38 void dump_ir_block_edge(ir_node *n);
39 /* dump edges to our inputs */
40 void dump_ir_data_edges(ir_node *n);
41 #endif
42
43 /****m* irdump/dump_ir_graph
44  *
45  * NAME
46  *   dump_ir_graph  -- dump a firm graph
47  * SYNOPSIS
48  *  void dump_ir_graph (ir_graph *irg);
49  * FUNCTION
50  *  Dumps all Firm nodes of a single graph for a single procedure in
51  *  standard xvcg format.
52  *  Dumps the graph to a file.  The file name is constructed from the
53  *  name of the entity describing the procedure (irg->entity) and the
54  *  ending .vcg.  Eventually overwrites existing files.
55  * INPUTS
56  *   irg: The firm graph to be dumped.
57  * RESULT
58  *   A file containing the firm graph in vcg format.
59  * SEE ALSO
60  *  turn_of_edge_labels
61  ***
62  */
63 void dump_ir_graph (ir_graph *irg);
64
65 /****m* irdump/dump_ir_block_graph
66  *
67  * NAME
68  *   dump_ir_block_graph -- dump a firm graph without explicit block nodes.
69  * SYNOPSIS
70  *   void dump_ir_block_graph (ir_graph *irg);
71  * FUNCTION
72  *  Dumps all Firm nodes of a single graph for a single procedure in
73  *  extended xvcg format.
74  *  Dumps the graph to a file.  The file name is constructed from the
75  *  name of the entity describing the procedure (irg->entity) and the
76  *  ending .vcg.  Eventually overwrites existing files.
77  * INPUTS
78  *   irg: The firm graph to be dumped.
79  * RESULT
80  *   A file containing the firm graph in vcg format.
81  * SEE ALSO
82  *  turn_of_edge_labels
83  ***
84  */
85 void dump_ir_block_graph (ir_graph *irg);
86
87 /****m* irdump/dump_cfg
88  *
89  * NAME
90  *   dump_cfg -- Dump the control flow graph of a procedure
91  * SYNOPSIS
92  *   void dump_cfg (ir_graph *irg);
93  * FUNCTION
94  *   Dumps the control flow graph of a procedure in standard xvcg format.
95  *   Dumps the graph to a file.  The file name is constructed from the
96  *   name of the entity describing the procedure (irg->entity) and the
97  *   ending -cfg.vcg.  Eventually overwrites existing files.
98  * INPUTS
99  *   irg: The firm graph whose CFG shall be dumped.
100  * RESULT
101  *   A file containing the CFG in vcg format.
102  * SEE ALSO
103  *  turn_of_edge_labels
104  ***
105  */
106 void dump_cfg (ir_graph *irg);
107
108 /****m* irdump/dump_type_graph
109  *
110  * NAME
111  *   dump_type_graph --
112  * SYNOPSIS
113  *   void dump_type_graph (ir_graph *irg);
114  * FUNCTION
115  *  Dumps all all the type information needed for Calls, Sels, ... in this graph.
116  *  Dumps the graph to a file.  The file name is constructed from the
117  *  name of the entity describing the procedure (irg->entity) and the
118  *  ending -type.vcg.  Eventually overwrites existing files.
119  * INPUTS
120  *  irg: The firm graph whose type information is to be dumped.
121  * RESULT
122  *  A file containing the type information of the firm graph in vcg format.
123  * SEE ALSO
124  *  turn_of_edge_labels
125  ***
126  */
127 void dump_type_graph (ir_graph *irg);
128
129 /****m* irdump/dump_all_types
130  *
131  * NAME
132  *   dump_all_types -- Dumps all type information
133  * SYNOPSIS
134  *   void dump_all_types (void);
135  * FUNCTION
136  *   Dumps all type information that is somehow reachable in standard vcg
137  *   format.
138  *   Dumps the graph to a file named All_types.vcg.
139  * INPUTS
140  *   No inputs.
141  * RESULT
142  *   A file containing all type information for the program in standard
143  *   vcg format.
144  * SEE ALSO
145  *  turn_of_edge_labels
146  ***
147  */
148 void dump_all_types (void);
149
150 /****m* irdump/dump_ir_graph_w_types
151  *
152  * NAME
153  *   dump_ir_graph_w_types
154  * SYNOPSIS
155  *   void dump_ir_graph_w_types (ir_graph *irg);
156  * FUNCTION
157  *  Dumps a firm graph and  all the type information needed for Calls, Sels, ... in this graph.
158  *  Dumps the graph to a file.  The file name is constructed from the
159  *  name of the entity describing the procedure (irg->entity) and the
160  *  ending -all.vcg.  Eventually overwrites existing files.
161  * INPUTS
162  *   irg: The firm graph to be dumped with its type information.
163  * RESULT
164  *   A file containing the firm graph and the type information of the firm graph in vcg format.
165  * SEE ALSO
166  *  turn_of_edge_labels
167  ***
168  */
169 void dump_ir_graph_w_types (ir_graph *irg);
170
171 /****m* irdump/dump_all_ir_graphs
172  *
173  * NAME
174  *   dump_all_ir_graphs -- a walker that calls a dumper for each graph
175  * SYNOPSIS
176  *   void dump_all_ir_graphs (void dump_graph(ir_graph*));
177  * FUNCTION
178  *   Walks over all firm graphs and  calls a dumper for each graph.
179  *   The following dumpers can be passed as arguments:
180  *   dump_ir_graph
181  *   dump_ir_block_graph
182  *   dump_cfg
183  *   dump_type_graph
184  *   dump_ir_graph_w_types
185  * INPUTS
186  *   The dumper to be used for dumping.
187  * RESULT
188  *   Whatever the dumper creates.
189  * SEE ALSO
190  *  turn_of_edge_labels
191  ***
192  */
193 void dump_all_ir_graphs (void dump_graph(ir_graph*));
194
195 /****m* irdump/turn_of_edge_labels
196  *
197  * NAME
198  *   turn_of_edge_labels
199  * SYNOPSIS
200  *   void turn_of_edge_labels();
201  * FUNCTION
202  *   Sets the vcg flag "display_edge_labels" to no.  This is necessary
203  *   as xvcg and aisee both fail to display graphs with self-edges if these
204  *   edges have labes.
205  * INPUTS
206  *   No inputs
207  * RESULT
208  *   dumpers will generate vcg flags with a different header.
209  * SEE ALSO
210  *
211  ***
212  */
213 void turn_of_edge_labels();
214
215
216 # endif /* _IRDUMP_H_ */