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