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