don't use __PTR_TO_INT from obstack.h... well the code is still using obstack interna...
[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 #define POSTDOMINATOR_EDGE_ATTR  "class:19 color:red linestyle:dotted"
24
25 #define BACK_EDGE_ATTR "linestyle:dashed "
26
27 /* Attributes of edges between Firm nodes and type/entity nodes */
28 #define NODE2TYPE_EDGE_ATTR "class:2 priority:2 linestyle:dotted"
29
30 /* Attributes of edges in type/entity graphs. */
31 #define TYPE_METH_NODE_ATTR      "color: lightyellow"
32 #define TYPE_CLASS_NODE_ATTR     "color: green"
33 #define TYPE_DESCRIPTION_NODE_ATTR "color: lightgreen"
34 #define ENTITY_NODE_ATTR         "color: yellow"
35 #define ENT_TYPE_EDGE_ATTR       "class: 3 label: \"type\" color: red"
36 #define ENT_OWN_EDGE_ATTR        "class: 4 label: \"owner\" color: black"
37 #define METH_PAR_EDGE_ATTR       "class: 5 label: \"param %d\" color: green"
38 #define METH_RES_EDGE_ATTR       "class: 6 label: \"res %d\" color: green"
39 #define TYPE_SUPER_EDGE_ATTR     "class: 7 label: \"supertype\" color: red"
40 #define UNION_EDGE_ATTR          "class: 8 label: \"component\" color: blue"
41 #define PTR_PTS_TO_EDGE_ATTR     "class: 9 label: \"points to\" color:green"
42 #define ARR_ELT_TYPE_EDGE_ATTR   "class: 10 label: \"arr elt tp\" color:green"
43 #define ARR_ENT_EDGE_ATTR        "class: 10 label: \"arr ent\" color: green"
44 #define ENT_OVERWRITES_EDGE_ATTR "class: 11 label: \"overwrites\" color:red"
45 #define ENT_VALUE_EDGE_ATTR      "label: \"value %d\""
46 #define ENT_CORR_EDGE_ATTR       "label: \"value %d corresponds to \" "
47 #define TYPE_MEMBER_EDGE_ATTR    "class: 12 label: \"member\" color:blue"
48 #define ENUM_ITEM_NODE_ATTR      "color: green"
49 /* #define CALLGRAPH_EDGE_ATTR      "calls" */
50
51 #define PRINT_NODEID(X)       fprintf(F, "n%ld", get_irn_node_nr(X))
52 #define PRINT_TYPEID(X)       fprintf(F, "\"t%ld\"", get_type_nr(X))
53 #define PRINT_ENTID(X)        fprintf(F, "e%ld", get_entity_nr(X))
54 #define PRINT_IRGID(X)        fprintf(F, "g%ld", get_irg_graph_nr(X))
55 #define PRINT_CONSTID(X,Y)    fprintf(F, "\"n%ldn%ld\"", get_irn_node_nr(X),get_irn_node_nr(Y))
56 #define PRINT_CONSTBLKID(X,Y) fprintf(F, "n%ldb%ld", get_irn_node_nr(X),get_irn_node_nr(Y))
57 #define PRINT_LOOPID(X)       fprintf(F, "l%d", get_loop_loop_nr(X))
58 #define PRINT_ITEMID(X,Y)     fprintf(F, "i%ldT%d", get_type_nr(X), (Y))
59 #define PRINT_EXTBBID(X)      fprintf(F, "x%ld", get_irn_node_nr(X))
60
61 extern int dump_dominator_information_flag;
62 extern int opt_dump_pointer_values_to_info;
63 extern int opt_dump_analysed_type_info;
64
65 FILE *vcg_open (ir_graph *irg, const char * suffix1, const char *suffix2);
66 FILE *vcg_open_name (const char *name, const char *suffix);
67 void dump_vcg_header(FILE *F, const char *name, const char *orientation);
68 const char *get_irg_dump_name(ir_graph *irg);
69 void vcg_close (FILE *F);
70
71
72 const char *get_ent_dump_name(ir_entity *ent);
73 const char *get_type_name_ex(ir_type *tp, int *bad);
74 const char *get_mode_name_ex(ir_mode *mode, int *bad);
75 /**
76  * dump the name of a node n to the File F.
77  */
78 int
79 dump_node_opcode(FILE *F, ir_node *n);
80
81 int dump_node_label(FILE *F, ir_node *n);
82
83
84 /** Writes vcg representation with title "PRINT_TYPEID(tp)" to file F. */
85 int dump_type_node(FILE *F, ir_type *tp);
86
87
88
89 #endif /* __IRDUMPT_T_H__ */