more verbose dumper,
[libfirm] / ir / ir / irdump_t.h
1
2
3 #ifndef __IRDUMPT_T_H__
4 #define __IRDUMPT_T_H__
5
6 #include "irdump.h"
7
8 /* Attributes of nodes */
9 #define PRINT_DEFAULT_NODE_ATTR
10 #define DEFAULT_NODE_ATTR " "
11 #define DEFAULT_TYPE_ATTRIBUTE " "
12 #define DEFAULT_ENUM_ITEM_ATTRIBUTE " "
13
14 /* Attributes of edges between Firm nodes */
15 #define INTRA_DATA_EDGE_ATTR "class:1  priority:50"
16 #define INTER_DATA_EDGE_ATTR "class:16 priority:10"
17 #define BLOCK_EDGE_ATTR      "class:2  priority:50 linestyle:dotted"
18 #define CF_EDGE_ATTR         "class:13 priority:60 color:red"
19 #define EXC_CF_EDGE_ATTR     "class:18 priority:60 color:blue"
20 #define INTRA_MEM_EDGE_ATTR  "class:14 priority:50 color:blue"
21 #define INTER_MEM_EDGE_ATTR  "class:17 priority:10 color:blue"
22 #define DOMINATOR_EDGE_ATTR  "class:15 color:red"
23
24 #define BACK_EDGE_ATTR "linestyle:dashed "
25
26 /* Attributes of edges between Firm nodes and type/entity nodes */
27 #define NODE2TYPE_EDGE_ATTR "class:2 priority:2 linestyle:dotted"
28
29 /* Attributes of edges in type/entity graphs. */
30 #define TYPE_METH_NODE_ATTR      "color: lightyellow"
31 #define TYPE_CLASS_NODE_ATTR     "color: green"
32 #define TYPE_DESCRIPTION_NODE_ATTR "color: lightgreen"
33 #define ENTITY_NODE_ATTR         "color: yellow"
34 #define ENT_TYPE_EDGE_ATTR       "class: 3 label: \"type\" color: red"
35 #define ENT_OWN_EDGE_ATTR        "class: 4 label: \"owner\" color: black"
36 #define METH_PAR_EDGE_ATTR       "class: 5 label: \"param %d\" color: green"
37 #define METH_RES_EDGE_ATTR       "class: 6 label: \"res %d\" color: green"
38 #define TYPE_SUPER_EDGE_ATTR     "class: 7 label: \"supertype\" color: red"
39 #define UNION_EDGE_ATTR          "class: 8 label: \"component\" color: blue"
40 #define PTR_PTS_TO_EDGE_ATTR     "class: 9 label: \"points to\" color:green"
41 #define ARR_ELT_TYPE_EDGE_ATTR   "class: 10 label: \"arr elt tp\" color:green"
42 #define ARR_ENT_EDGE_ATTR        "class: 10 label: \"arr ent\" color: green"
43 #define ENT_OVERWRITES_EDGE_ATTR "class: 11 label: \"overwrites\" color:red"
44 #define ENT_VALUE_EDGE_ATTR      "label: \"value %d\""
45 #define ENT_CORR_EDGE_ATTR       "label: \"value %d corresponds to \" "
46 #define TYPE_MEMBER_EDGE_ATTR    "class: 12 label: \"member\" color:blue"
47 #define ENUM_ITEM_NODE_ATTR      "color: green"
48 #define CALLGRAPH_EDGE_ATTR      "calls"
49
50 #define PRINT_NODEID(X)       fprintf(F, "n%ld", get_irn_node_nr(X))
51 #define PRINT_TYPEID(X)       fprintf(F, "\"t%ld\"", get_type_nr(X))
52 #define PRINT_ENTID(X)        fprintf(F, "e%ld", get_entity_nr(X))
53 #define PRINT_IRGID(X)        fprintf(F, "g%ld", get_irg_graph_nr(X))
54 #define PRINT_CONSTID(X,Y)    fprintf(F, "\"n%ldn%ld\"", get_irn_node_nr(X),get_irn_node_nr(Y))
55 #define PRINT_CONSTBLKID(X,Y) fprintf(F, "n%ldb%ld", get_irn_node_nr(X),get_irn_node_nr(Y))
56 #define PRINT_LOOPID(X)       fprintf(F, "l%d", get_loop_loop_nr(X))
57 #define PRINT_ITEMID(X,Y)     fprintf(F, "i%ldT%d", get_type_nr(X), (Y))
58
59 extern int dump_dominator_information_flag;
60 extern bool opt_dump_pointer_values_to_info;
61 extern bool opt_dump_analysed_type_info;
62
63 FILE *vcg_open (ir_graph *irg, const char * suffix1, const char *suffix2);
64 FILE *vcg_open_name (const char *name, const char *suffix);
65 void dump_vcg_header(FILE *F, const char *name, const char *orientation);
66 const char *get_irg_dump_name(ir_graph *irg);
67 void vcg_close (FILE *F);
68
69
70 const char *get_ent_dump_name(entity *ent);
71 const char *get_type_name_ex(type *tp, int *bad);
72 const char *get_mode_name_ex(ir_mode *mode, int *bad);
73 /**
74  * dump the name of a node n to the File F.
75  */
76 int
77 dump_node_opcode(FILE *F, ir_node *n);
78
79 int dump_node_label(FILE *F, ir_node *n);
80
81
82 /** Writes vcg representation with titel "PRINT_TYPEID(tp)" to file F. */
83 int dump_type_node(FILE *F, type *tp);
84
85 #endif /* __IRDUMPT_T_H__ */