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