make display of node idx configurable and disable it by default
[libfirm] / include / libfirm / irdump.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   Write vcg representation of firm to file.
23  * @author  Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Hubert Schmidt
24  * @version $Id$
25  * @summary
26  *  Dump routines for the ir graph and all type information.
27  *
28  *  The dump format of most functions is vcg.  This is a text based graph
29  *  representation. Some use the original format,
30  *  but most generate an extended format that is only read by some special
31  *  versions of xvcg or by the comercialized version now calles aiSee.
32  *  A test version of aiSee is available at
33  *   http://www.absint.de/aisee/download/index.htm.
34  *
35  *  We have developed an own advanced viewer called ycomp:
36  *    http://www.info.uni-karlsruhe.de/software.php/id=6&lang=en
37  *
38  *  Most routines use the name of the passed entity as the name of the
39  *  file dumped to.
40  */
41 #ifndef FIRM_IR_IRDUMP_H
42 #define FIRM_IR_IRDUMP_H
43
44 #include "irnode.h"
45 #include "irgraph.h"
46 #include "irloop.h"
47
48 /**
49  * Names of the 32 supported colors
50  */
51 typedef enum {
52   ird_color_default      = -1,
53   ird_color_white        = 0,
54   ird_color_blue         = 1,
55   ird_color_red          = 2,
56   ird_color_green        = 3,
57   ird_color_yellow       = 4,
58   ird_color_magenta      = 5,
59   ird_color_cyan         = 6,
60   ird_color_darkgray     = 7,
61   ird_color_darkblue     = 8,
62   ird_color_darkred      = 9,
63   ird_color_darkgreen    = 10,
64   ird_color_darkyellow   = 11,
65   ird_color_darkmagenta  = 12,
66   ird_color_darkcyan     = 13,
67   ird_color_gold         = 14,
68   ird_color_lightgray    = 15,
69   ird_color_lightblue    = 16,
70   ird_color_lightred     = 17,
71   ird_color_lightgreen   = 18,
72   ird_color_lightyellow  = 19,
73   ird_color_lightmagenta = 20,
74   ird_color_lightcyan    = 21,
75   ird_color_lilac        = 22,
76   ird_color_turquoise    = 23,
77   ird_color_aquamarine   = 24,
78   ird_color_khaki        = 25,
79   ird_color_purple       = 26,
80   ird_color_yellowgreen  = 27,
81   ird_color_pink         = 28,
82   ird_color_orange       = 29,
83   ird_color_orchid       = 30,
84   ird_color_black        = 31
85 } dumper_colors;
86
87 /**
88  * Edge kinds
89  */
90 typedef enum {
91   data_edge           = 0x01,   /**< a data edge between two basic blocks */
92   block_edge          = 0x02,   /**< an edge from a node to its basic block */
93   cf_edge             = 0x03,   /**< regularly control flow edge */
94   exc_cf_edge         = 0x04,   /**< exceptional control flow edge */
95   mem_edge            = 0x05,   /**< memory edge */
96   dominator_edge      = 0x06,   /**< dominator edge */
97   node2type_edge      = 0x07,   /**< an edge from an IR node to a type */
98
99   ent_type_edge       = 0x11,   /**< an edge from an entity to its type */
100   ent_own_edge        = 0x12,   /**< an edge from an entity to its owner type */
101   ent_overwrites_edge = 0x13,   /**< an edge from an entity to the entity it overwrites */
102   ent_value_edge      = 0x14,   /**< an edge from an entity to its value entity */
103   ent_corr_edge       = 0x15,   /**< an edge from an entity to the member entity its initializes */
104
105   meth_par_edge       = 0x21,   /**< an edge from a method type to one of its parameter types */
106   meth_res_edge       = 0x22,   /**< an edge from a method type to one of its result types */
107   type_super_edge     = 0x23,   /**< an edge from a class type to its super/basis type */
108   union_edge          = 0x24,   /**< an edge from a union type to its member types */
109   ptr_pts_to_edge     = 0x25,   /**< an edge from a pointer type to its points-to type */
110   arr_elt_type_edge   = 0x26,   /**< an edge from an array type to its element type */
111   arr_ent_edge        = 0x27,   /**< an edge from a array type to its element entity */
112   type_member_edge    = 0x28,   /**< an edge from a compound type to its member entities */
113
114   /* additional flags */
115   intra_edge          = 0,      /**< intra edge flag: edge do not cross basic block boundaries */
116   inter_edge          = 0x40,   /**< inter edge flag: edge cross basic block boundaries */
117   back_edge           = 0x80    /**< backwards edge flag */
118 } edge_kind;
119
120 /* **************************************************************************** */
121 /*                                 GRAPH DUMPERS                                */
122 /* **************************************************************************** */
123
124 /**
125  * This hook is called to insert some special nodes into dumped graph
126  */
127 typedef int (*DUMP_IR_GRAPH_FUNC)(FILE *F, ir_graph *irg);
128 /**
129  * This hook is called to dump the vcg attributes of a node to a file.
130  * If this function returns zero, the default attributes are added, else
131  * removed.
132  */
133 typedef int (*DUMP_NODE_VCGATTR_FUNC)(FILE *F, ir_node *node, ir_node *local);
134 /**
135  * This hook is called to dump the vcg attributes of an edge to a file.
136  * If this function returns zero, the default attributes are added, else
137  * removed.
138  */
139 typedef int (*DUMP_EDGE_VCGATTR_FUNC)(FILE *F, ir_node *node, int to);
140
141 /** Set the ir graph dump hook. */
142 void set_dump_ir_graph_hook(DUMP_IR_GRAPH_FUNC hook);
143 /** Set the node_vcgattr hook. */
144 void set_dump_node_vcgattr_hook(DUMP_NODE_VCGATTR_FUNC hook);
145 /** Set the edge_vcgattr hook. */
146 void set_dump_edge_vcgattr_hook(DUMP_EDGE_VCGATTR_FUNC hook);
147
148 typedef int (*DUMP_NODE_EDGE_FUNC)(FILE *f, ir_node *node);
149
150 /**
151  * Set the hook to be called to dump additional edges to a node.
152  * @param func The hook to be called.
153  */
154 void set_dump_node_edge_hook(DUMP_NODE_EDGE_FUNC func);
155
156 /**
157  * Get the additional edge dump hook.
158  * @return The current additional edge dump hook.]
159  */
160 DUMP_NODE_EDGE_FUNC get_dump_node_edge_hook(void);
161
162 /**
163  * Set the hook to be called to dump additional edges to a block.
164  * @param func The hook to be called.
165  */
166 void set_dump_block_edge_hook(DUMP_NODE_EDGE_FUNC func);
167
168 /**
169  * Get the additional block edge dump hook.
170  * @return The current additional block edge dump hook.
171  */
172 DUMP_NODE_EDGE_FUNC get_dump_block_edge_hook(void);
173
174 /** Dump a firm graph.
175  *
176  *  @param irg     The firm graph to be dumped.
177  *  @param suffix  A suffix for the file name.
178  *
179  *  @return
180  *     A file containing the firm graph in vcg format.
181  *
182  *  Dumps all Firm nodes of a single graph for a single procedure in
183  *  standard xvcg format.  Dumps the graph to a file.  The file name
184  *  is constructed from the name of the entity describing the
185  *  procedure (irg->entity) and the ending -pure<-ip>.vcg.  Eventually
186  *  overwrites existing files.  Visits all nodes in
187  *  interprocedural_view.
188  *
189  * @see turn_off_edge_labels()
190  */
191 void dump_ir_graph (ir_graph *irg, const char *suffix);
192
193 /** Dump a firm graph without explicit block nodes.
194  *
195  *  @param irg     The firm graph to be dumped.
196  *  @param suffix  A suffix for the file name.
197  *
198  *  @return
199  *     A file containing the firm graph in vcg format.
200  *
201  *  Dumps all Firm nodes of a single graph for a single procedure in
202  *  extended xvcg format.
203  *  Dumps the graph to a file.  The file name is constructed from the
204  *  name of the entity describing the procedure (irg->entity) and the
205  *  ending <-ip>.vcg.  Eventually overwrites existing files.  Dumps several
206  *  procedures in boxes if interprocedural_view.
207  *
208  * @see turn_off_edge_labels()
209  */
210 void dump_ir_block_graph (ir_graph *irg, const char *suffix);
211
212 /** Dump a firm graph without explicit block nodes but grouped in extended blocks.
213  *
214  *  @param irg   The firm graph to be dumped.
215  *
216  *  @return
217  *     A file containing the firm graph in vcg format.
218  *
219  *  Dumps all Firm nodes of a single graph for a single procedure in
220  *  extended xvcg format.
221  *  Dumps the graph to a file.  The file name is constructed from the
222  *  name of the entity describing the procedure (irg->entity) and the
223  *  ending <-ip>.vcg.  Eventually overwrites existing files.  Dumps several
224  *  procedures in boxes if interprocedural_view.
225  *
226  * @see turn_off_edge_labels()
227  */
228 void dump_ir_extblock_graph (ir_graph *irg, const char *suffix);
229
230 /** Dumps all graphs in interprocedural view to a file named All_graphs<suffix>.vcg.
231  *
232  * @param suffix  A suffix for the file name.
233  */
234 void dump_all_cg_block_graph(const char *suffix);
235
236 /** Dumps a firm graph and  all the type information needed for Calls,
237  *  Sels, ... in this graph.
238  *
239  *  @param irg     The firm graph to be dumped with its type information.
240  *  @param suffix  A suffix for the file name.
241  *
242  *  @return
243  *      A file containing the firm graph and the type information of the firm graph in vcg format.
244  *
245  *  Dumps the graph to a file.  The file name is constructed from the
246  *  name of the entity describing the procedure (irg->entity) and the
247  *  ending -all.vcg.  Eventually overwrites existing files.
248  *
249  * @see turn_off_edge_labels()
250  */
251 void dump_ir_graph_w_types (ir_graph *irg, const char *suffix);
252
253 /** Dumps a firm graph and  all the type information needed for Calls,
254  *  Sels, ... in this graph.
255  *
256  *  @param irg     The firm graph to be dumped with its type information.
257  *  @param suffix  A suffix for the file name.
258  *
259  *  @return
260  *      A file containing the firm graph and the type information of the firm graph in vcg format.
261  *
262  *  The graph is in blocked format.
263  *  Dumps the graph to a file.  The file name is constructed from the
264  *  name of the entity describing the procedure (irg->entity) and the
265  *  ending -all.vcg.  Eventually overwrites existing files.
266  *
267  * @see turn_off_edge_labels()
268  */
269 void dump_ir_block_graph_w_types (ir_graph *irg, const char *suffix);
270
271 /** The type of a dump function that is called for each graph.
272  *
273  *  @param irg     current visited graph
274  *  @param suffix  A suffix for the file name.
275  */
276 typedef void dump_graph_func(ir_graph *irg, const char *suffix);
277
278 /**
279  * A walker that calls a dumper for each graph.
280  *
281  * @param dump_graph    The dumper to be used for dumping.
282  * @param suffix        A suffix for the file name.
283  *
284  * @return
285  *      Whatever the dumper creates.
286  *
287  *  Walks over all firm graphs and  calls a dumper for each graph.
288  *  The following dumpers can be passed as arguments:
289  *   - dump_ir_graph()
290  *   - dump_ir_block_graph()
291  *   - dump_cfg()
292  *   - dump_type_graph()
293  *   - dump_ir_graph_w_types()
294  *
295  * @see turn_off_edge_labels()
296  */
297 void dump_all_ir_graphs (dump_graph_func *dump_graph, const char *suffix);
298
299
300 /**
301  * Dump the control flow graph of a procedure.
302  *
303  * @param irg     The firm graph whose CFG shall be dumped.
304  * @param suffix  A suffix for the file name.
305  *
306  * @return
307  *      A file containing the CFG in vcg format.
308  *
309  * Dumps the control flow graph of a procedure in standard xvcg format.
310  * Dumps the graph to a file.  The file name is constructed from the
311  * name of the entity describing the procedure (irg->entity) and the
312  * ending -cfg.vcg.  Eventually overwrites existing files.
313  *
314  * @see turn_off_edge_labels()
315  */
316 void dump_cfg (ir_graph *irg, const char *suffix);
317
318 /**
319  * Dump a node and its predecessors forming a subgraph to a vcg file.
320  *
321  * @param root   The node serving as root for the subgraph.
322  * @param depth  Dump nodes on paths starting at root with length depth.
323  * @param suffix A suffix for the file name.
324  *
325  * Dumps the graph to a file.  The file name is constructed from the
326  * name of the entity describing the procedure the passed node is
327  * in, suffix and the ending -subg_<nr>.vcg.  nr is a unique number
328  * for each graph dumped. Eventually overwrites existing files.
329  *
330  * @return
331  *      A file containing the subgraph in vcg format.
332  */
333 void dump_subgraph (ir_node *root, int depth, const char *suffix);
334
335 /* **************************************************************************** */
336 /*                              CALLGRAPH DUMPERS                               */
337 /* **************************************************************************** */
338
339
340 /** Dump the call graph.
341  *
342  * Dumps the callgraph to a file "Callgraph"<suffix>".vcg".
343  *
344  * @param suffix A suffix for the file name.
345  *
346  * @see dump_callgraph_loop_tree(const char *suffix)
347  */
348 void dump_callgraph(const char *suffix);
349
350 /* **************************************************************************** */
351 /*                              TYPEGRAPH DUMPERS                               */
352 /* **************************************************************************** */
353
354 /**
355  * Dumps all the type information needed for Calls, Sels, ... in this graph.
356  * Does not dump the graph!
357  *
358  * @param irg    The firm graph whose type information is to be dumped.
359  * @param suffix A suffix for the file name.
360  *
361  * @return
362  *      A file containing the type information of the firm graph in vcg format.
363  *
364  *  Dumps this graph to a file.  The file name is constructed from the
365  *  name of the entity describing the procedure (irg->entity) and the
366  *  ending -type.vcg.  Eventually overwrites existing files.
367  *
368  * @see turn_off_edge_labels()
369  */
370 void dump_type_graph (ir_graph *irg, const char *suffix);
371
372 /**
373  * Dumps all type information.
374  *
375  * @param suffix A suffix for the file name.
376  *
377  * @return
378  *      A file containing all type information for the program in standard
379  *      vcg format.
380  *
381  * Dumps all type information that is somehow reachable in standard vcg
382  * format.
383  * Dumps the graph to a file named All_types.vcg.
384  *
385  * @see turn_off_edge_labels()
386  */
387 void dump_all_types (const char *suffix);
388
389 /**
390  * Dumps the class hierarchy with or without entities.
391  *
392  * @param entities    Flag whether to dump the entities.
393  * @param suffix      A suffix for the file name.
394  *
395  * @return
396  *      A file containing the class hierarchy tree for the program in standard
397  *      vcg format.
398  *
399  * Does not dump the global type.
400  * Dumps a node for all classes and the sub/supertype relations.  If
401  * entities is set to true also dumps the entities of classes, but without
402  * any additional information as the entities type.  The overwrites relation
403  * is dumped along with the entities.
404  * Dumps to a file class_hierarchy.vcg
405  */
406 void dump_class_hierarchy (int entities, const char *suffix);
407
408 /* **************************************************************************** */
409 /*                              LOOPTREE DUMPERS                                */
410 /* **************************************************************************** */
411
412 /**
413  * Dump a standalone loop tree, which contains the loop nodes and the firm nodes
414  * belonging to one loop packed together in one subgraph.  Dumps to file
415  * <name of irg><suffix>-looptree.vcg
416  * Turns on edge labels by default.
417  *
418  * Implementing this dumper was stimulated by Florian Liekwegs similar dumper.
419  *
420  * @param irg     Dump the loop tree for this graph.
421  * @param suffix  A suffix for the file name.
422  */
423 void dump_loop_tree(ir_graph *irg, const char *suffix);
424
425 /** Dumps the firm nodes in the sub-loop-tree of loop to a graph.
426  *
427  * Dumps the loop nodes if dump_loop_information() is set.
428  * The name of the file is loop_<loop_nr><suffix>.vcg.
429  *
430  * @param l       Dump the loop tree for this loop.
431  * @param suffix  A suffix for the file name.
432  */
433 void dump_loop (ir_loop *l, const char *suffix);
434
435 /** Dumps the loop tree over the call graph.
436  *
437  * See for yourself what you can use this for.
438  * The filename is "Callgraph_looptree<suffix>.vcg".
439  *
440  * @param suffix  A suffix for the file name.
441  */
442 void dump_callgraph_loop_tree(const char *suffix);
443
444
445 /* **************************************************************************** */
446 /*                                TEXT DUMPERS                                  */
447 /* **************************************************************************** */
448
449
450 /** Write the irnode and all its attributes to the file passed.
451  * */
452 int dump_irnode_to_file (FILE *f, ir_node *n);
453
454 /** Write the irnode and all its attributes to stdout.
455  *  */
456 void dump_irnode (ir_node *n);
457
458 /** Write the graph and all its attributes to the file passed.
459  *  Does not write the nodes.
460  * */
461 void dump_graph_to_file(FILE *F, ir_graph *irg);
462
463 /** Write the graph and all its attributes to stdout.
464  *  Does not write the nodes.
465  *  */
466 void dump_graph(ir_graph *g);
467
468
469 /** Dump graph information as text.
470  *
471  *  Often graphs are unhandy in their vcg representation.  The text
472  *  dumper represents the information for the firm nodes more compact,
473  *  but the relations between the nodes only implicitly.
474  *
475  *  The file name is the graph name (get_entity_name()), appended by
476  *  <suffix>.txt.
477  */
478 void dump_graph_as_text(ir_graph *irg, const char *suffix);
479
480
481 /** Verbosity for text dumpers */
482 typedef enum {
483   dump_verbosity_onlynames         = 0x00000001,   /**< only dump names. turns off all other
484                                                         flags up to 0x00010000. */
485   dump_verbosity_fields            = 0x00000002,   /**< dump types and fields (like a type declaration) */
486   dump_verbosity_methods           = 0x00000004,   /**< dump types and methods (like a type declaration) */
487   dump_verbosity_nostatic          = 0x00000040,   /**< dump types and dynamic allocated fields (like a
488                                                         type declaration). This excludes methods and
489                                                         static, polymorphic fields. */
490   dump_verbosity_typeattrs         = 0x00000008,   /**< dump all type attributes */
491   dump_verbosity_entattrs          = 0x00000010,   /**< dump all entity attributes */
492   dump_verbosity_entconsts         = 0x00000020,   /**< dump entity constants */
493
494   dump_verbosity_accessStats       = 0x00000100,   /**< dump entity access statistics */
495   dump_verbosity_csv               = 0x00000200,   /**< dump access statistics as comma separated list */
496
497   dump_verbosity_noClassTypes      = 0x00001000,   /**< dump no class       types */
498   dump_verbosity_noStructTypes     = 0x00002000,   /**< dump no struct      types */
499   dump_verbosity_noUnionTypes      = 0x00004000,   /**< dump no union       types */
500   dump_verbosity_noArrayTypes      = 0x00008000,   /**< dump no array       types */
501   dump_verbosity_noPointerTypes    = 0x00010000,   /**< dump no pointer     types */
502   dump_verbosity_noMethodTypes     = 0x00020000,   /**< dump no method      types */
503   dump_verbosity_noPrimitiveTypes  = 0x00040000,   /**< dump no primitive   types */
504   dump_verbosity_noEnumerationTypes= 0x00080000,   /**< dump no enumeration types */
505
506   dump_verbosity_onlyClassTypes     = 0x000FE000,  /**< dump only class     types */
507   dump_verbosity_onlyStructTypes    = 0x000FD000,  /**< dump only struct    types */
508   dump_verbosity_onlyUnionTypes     = 0x000FB000,  /**< dump only union     types */
509   dump_verbosity_onlyArrayTypes     = 0x000F7000,  /**< dump only array     types */
510   dump_verbosity_onlyPointerTypes   = 0x000EF000,  /**< dump only pointer   types */
511   dump_verbosity_onlyMethodTypes    = 0x000DF000,  /**< dump only method    types */
512   dump_verbosity_onlyPrimitiveTypes = 0x000BF000,  /**< dump only primitive types */
513   dump_verbosity_onlyEnumerationTypes=0x0007F000,  /**< dump only enumeration types */
514
515   dump_verbosity_max                = 0x4FF00FBE   /**< turn on all verbosity.
516                                                         Do not turn on negative flags!
517                                                         @@@ Because of a bug in gcc 3.2 we can not set the
518                                                         first two bits. */
519 } dump_verbosity;
520
521
522 /** Write the entity and all its attributes to the passed file.
523  *  */
524 void    dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity);
525
526 /** Write the entity and all its attributes to the stdout.
527  *
528  *  Calls dump_entity_to_file().  */
529 void    dump_entity (ir_entity *ent);
530
531 /** Write the type and all its attributes to the file passed.
532  * */
533 void    dump_type_to_file (FILE *f, ir_type *tp, dump_verbosity verbosity);
534
535 /** Write the type and all its attributes to stdout.
536  *  */
537 void    dump_type (ir_type *tp);
538
539
540 /** Dump type information as text.
541  *
542  *  Often type graphs are unhandy in their vcg representation.  The text
543  *  dumper represents the information for a single type more compact, but
544  *  the relations between the types only implicitly.
545  *  Dumps only 'real' types, i.e., those in the type list.  Does not dump
546  *  the global type nor frame types or the like.
547  *
548  *  The file name is the program name (get_irp_name()), or 'TextTypes'
549  *  if the program name is not set, appended by <suffix>-types.txt.
550  *  For verbosity see the documentation of the verbosity flags above.
551  */
552 void dump_types_as_text(unsigned verbosity, const char *suffix);
553
554 /** Dumps all global variables as text.
555  *
556  * @param suffix  A suffix for the file name.
557  *
558  * Dumps a text representation of the entities in the global type.
559  *
560  * The file name is the program name (get_irp_name()), or 'TextTypes'
561  * if the program name is not set, appended by <suffix>-globals.txt.
562  * For verbosity see the documentation of the verbosity flags above.
563  */
564 void dump_globals_as_text(unsigned verbosity, const char *suffix);
565
566 /* **************************************************************************** */
567 /*                                    FLAGS                                     */
568 /* **************************************************************************** */
569
570 /** Set a prefix filter for output functions.
571  *
572  * All graph dumpers check this name.  If the name is != "" and
573  * not a prefix of the graph to be dumped, the dumper does not
574  * dump the graph.
575  *
576  * @param name The prefix of the name (not the ld_name) of the method
577  *              entity to be dumped.
578  */
579 void   only_dump_method_with_name(ident *name);
580
581 /** Returns the prefix filter set with only_dump_method_with_name(). */
582 ident *get_dump_file_filter_ident(void);
583
584 /** Returns true if dump file filter is not set, or if it is a
585  *  prefix of name. */
586 int is_filtered_dump_name(ident *name);
587
588 /** Sets the vcg flag "display_edge_labels" to no.
589  *
590  * This is necessary as xvcg and aisee both fail to display graphs
591  * with self-edges if these edges have labels.
592  */
593 void turn_off_edge_labels(void);
594
595 /**
596  * If set to non-zero constants will be replicated for every use. In non
597  * blocked view edges from constant to block are skipped.  Vcg then
598  * layouts the graphs more compact, this makes them better readable.
599  * The flag is automatically and temporarily set to false if other
600  * edges are dumped, as outs, loop, ...
601  * Default setting: false.
602  */
603 void dump_consts_local(int flag);
604
605 /**
606  * if set to non-zero node idx will be added to node labels
607  */
608 void dump_node_idx_label(int flag);
609
610 /**
611  * Returns 0 if dump_out_edge_flag or dump_loop_information_flag
612  * are set, else returns dump_const_local_flag.
613  */
614 int get_opt_dump_const_local(void);
615
616 /**  Turns off dumping the values of constant entities. Makes type graphs
617  *   better readable.
618  */
619 void dump_constant_entity_values(int flag);
620
621 /**  Turns on dumping the edges from the End node to nodes to be kept
622  *   alive.
623  */
624 void dump_keepalive_edges(int flag);
625 int get_opt_dump_keepalive_edges(void);
626
627 /** Turns on dumping the out edges starting from the Start block in
628  *  dump_ir_graph.
629  *
630  *  To test the consistency of the out data structure.
631  */
632 void dump_out_edges(int flag);
633
634 /** If this flag is set the dumper dumps edges to immediate dominator in cfg.
635  */
636 void dump_dominator_information(int flag);
637
638 /** If this flag is set the dumper dumps loop nodes and edges from
639  *  these nodes to the contained ir nodes.
640  *
641  *  If the loops are interprocedural nodes can be missing.
642  */
643 void dump_loop_information(int flag);
644
645 /** If set and backedge info is computed, backedges are dumped dashed
646  *  and as vcg 'backedge' construct.
647  *
648  *  Default: set.
649  */
650 void dump_backedge_information(int flag);
651
652 /** Dump the information of type field specified in ana/irtypeinfo.h.
653  *
654  *  If the flag is set, the type name is output in [] in the node label,
655  *  else it is output as info.
656  */
657 void set_opt_dump_analysed_type_info(int flag);
658
659 /** Write the address of a node into the vcg info.
660  *
661  *  This is off per default for automatic comparisons of
662  *  vcg graphs -- these will differ in the pointer values!
663  */
664 void dump_pointer_values_to_info(int flag);
665
666 /** Dumps ld_names of entities instead of there names.
667  *
668  * This option is on per default.
669  */
670 void dump_ld_names(int flag);
671
672 /** Dumps all graph anchor nodes, even if they
673  * are dead.
674  *
675  * This option is off per default.
676  */
677 void dump_all_anchors(int flag);
678
679 /** A node info dumper callback. */
680 typedef void (dump_node_info_cb_t)(void *data, FILE *f, const ir_node *n);
681
682 /**
683  * Adds a new node info dumper callback. It is possible to add an unlimited
684  * number of callbacks. The callbacks are called at the end of the default
685  * info dumper.
686  *
687  * @param cb    the callback function to be called
688  * @param data  a context parameter
689  *
690  * @return A callback handle.
691  *
692  * @note This functionality is only available, if Firm hooks are enabled (default).
693  */
694 void *dump_add_node_info_callback(dump_node_info_cb_t *cb, void *data);
695
696 /**
697  * Remove a previously added info dumper callback.
698  *
699  * @param handle  the callback handle returned from dump_add_node_info_callback()
700  */
701 void dump_remv_node_info_callback(void *handle);
702
703 #endif