1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer
6 ** dump an ir graph, for further use with xvcg
15 /****h* libfirm/irdump
18 * irdump -- 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 http://www.absint.de/aisee/download/index.htm.
26 * Most routines use the name of the passed entity as the name of the
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);
43 /****m* irdump/dump_ir_graph
46 * dump_ir_graph -- dump a firm graph
48 * void dump_ir_graph (ir_graph *irg);
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.
56 * irg: The firm graph to be dumped.
58 * A file containing the firm graph in vcg format.
63 void dump_ir_graph (ir_graph *irg);
65 /****m* irdump/dump_ir_block_graph
68 * dump_ir_block_graph -- dump a firm graph without explicit block nodes.
70 * void dump_ir_block_graph (ir_graph *irg);
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.
78 * irg: The firm graph to be dumped.
80 * A file containing the firm graph in vcg format.
85 void dump_ir_block_graph (ir_graph *irg);
87 /****m* irdump/dump_cfg
90 * dump_cfg -- Dump the control flow graph of a procedure
92 * void dump_cfg (ir_graph *irg);
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.
99 * irg: The firm graph whose CFG shall be dumped.
101 * A file containing the CFG in vcg format.
103 * turn_of_edge_labels
106 void dump_cfg (ir_graph *irg);
108 /****m* irdump/dump_type_graph
113 * void dump_type_graph (ir_graph *irg);
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.
120 * irg: The firm graph whose type information is to be dumped.
122 * A file containing the type information of the firm graph in vcg format.
124 * turn_of_edge_labels
127 void dump_type_graph (ir_graph *irg);
129 /****m* irdump/dump_all_types
132 * dump_all_types -- Dumps all type information
134 * void dump_all_types (void);
136 * Dumps all type information that is somehow reachable in standard vcg
138 * Dumps the graph to a file named All_types.vcg.
142 * A file containing all type information for the program in standard
145 * turn_of_edge_labels
148 void dump_all_types (void);
150 /****m* irdump/dump_ir_graph_w_types
153 * dump_ir_graph_w_types
155 * void dump_ir_graph_w_types (ir_graph *irg);
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.
162 * irg: The firm graph to be dumped with its type information.
164 * A file containing the firm graph and the type information of the firm graph in vcg format.
166 * turn_of_edge_labels
169 void dump_ir_graph_w_types (ir_graph *irg);
171 /****m* irdump/dump_all_ir_graphs
174 * dump_all_ir_graphs -- a walker that calls a dumper for each graph
176 * void dump_all_ir_graphs (void dump_graph(ir_graph*));
178 * Walks over all firm graphs and calls a dumper for each graph.
179 * The following dumpers can be passed as arguments:
181 * dump_ir_block_graph
184 * dump_ir_graph_w_types
186 * The dumper to be used for dumping.
188 * Whatever the dumper creates.
190 * turn_of_edge_labels
193 void dump_all_ir_graphs (void dump_graph(ir_graph*));
195 /****m* irdump/turn_of_edge_labels
198 * turn_of_edge_labels
200 * void turn_of_edge_labels();
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
208 * dumpers will generate vcg flags with a different header.
213 void turn_of_edge_labels();
216 # endif /* _IRDUMP_H_ */