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