colorize name dump
[libfirm] / ir / ana2 / pto_name.h
1 /* -*- c -*- */
2
3 /*
4   Project:     libFIRM
5   File name:   ir/ana/pto_name.h
6   Purpose:     Names for abstract objects
7   Author:      Florian
8   Modified by:
9   Created:     Sat Nov 13 19:35:27 CET 2004
10   CVS-ID:      $Id$
11   Copyright:   (c) 1999-2004 Universität Karlsruhe
12   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
13 */
14
15
16 # ifndef _PTO_NAME_
17 # define _PTO_NAME_
18
19 # include "pto_comp.h"          /* for pto_t */
20 # include "irnode.h"
21 # include "type.h"
22 # include "qset.h"
23
24 /* ===================================================
25    Global Defines:
26    =================================================== */
27
28 /* ===================================================
29    Global Data Types:
30    =================================================== */
31 typedef enum desc_kind_enum {
32   none,
33   object,
34   array
35 } desc_kind_t;
36
37 /* abstract super class for all descriptors */
38 typedef struct desc_str
39 {
40   int id;
41   int visit;
42   int col_idx;
43   desc_kind_t kind;
44   type *tp;
45   ir_node *node;                /* allocation node */
46   struct desc_str *prev;        /* linked list */
47 } desc_t;
48
49 /* object descriptor */
50 typedef struct obj_desc_str
51 {
52   int id;
53   int visit;
54   int col_idx;
55   desc_kind_t kind;
56   type *tp;
57   ir_node *node;                /* allocation node */
58   struct desc_str *prev;        /* linked list */
59
60   int n_fields;
61   entity **fields;
62   qset_t **values;
63 } obj_desc_t;
64
65 /* array descriptor */
66 typedef struct arr_desc_str
67 {
68   int id;
69   int visit;
70   int col_idx;
71   desc_kind_t kind;
72   type *tp;
73   ir_node *node;                /* allocation node */
74   struct desc_str *prev;        /* linked list */
75
76   qset_t *value;
77 } arr_desc_t;
78
79 /* ===================================================
80    Global Prototypes:
81    =================================================== */
82 /* Dump all names to a file of the given name */
83 void pto_dump_names (const char*);
84
85 /* Find the given descriptor's entry for the given entity */
86 qset_t *get_entry (desc_t*, entity*);
87
88 /* get a new descriptor for the given type at the given node */
89 desc_t *new_name (type*, ir_node*);
90
91 /* get a new descriptor for the given (presumably static) entity */
92 desc_t *new_ent_name (entity*);
93
94 /* Initialise the name module */
95 void pto_name_init (void);
96
97 /* Cleanup the name module */
98 void pto_name_cleanup (void);
99
100 /* ===================================================
101    Global Variables:
102    =================================================== */
103
104
105 # endif /* not defined _PTO_NAME_ */
106
107
108 \f
109 /*
110   $Log$
111   Revision 1.5  2004/12/06 12:52:09  liekweg
112   colorize name dump
113
114   Revision 1.4  2004/11/30 15:49:27  liekweg
115   include 'dump'
116
117   Revision 1.3  2004/11/30 14:47:54  liekweg
118   fix initialisation; do correct iteration
119
120   Revision 1.2  2004/11/24 14:53:56  liekweg
121   Bugfixes
122
123   Revision 1.1  2004/11/18 16:37:34  liekweg
124   rewritten
125
126
127 */