ir/ir/irop_t.h added
[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 ctx;
43   int col_idx;
44   desc_kind_t kind;
45   ir_type *tp;
46   ir_node *node;                /* allocation node */
47   struct desc_str *prev;        /* linked list */
48 } desc_t;
49
50 /* object descriptor */
51 typedef struct obj_desc_str
52 {
53   int id;
54   int visit;
55   int ctx;
56   int col_idx;
57   desc_kind_t kind;
58   ir_type *tp;
59   ir_node *node;                /* allocation node */
60   struct desc_str *prev;        /* linked list */
61
62   int n_fields;
63   entity **fields;
64   qset_t **values;
65 } obj_desc_t;
66
67 /* array descriptor */
68 typedef struct arr_desc_str
69 {
70   int id;
71   int visit;
72   int ctx;
73   int col_idx;
74   desc_kind_t kind;
75   ir_type *tp;
76   ir_node *node;                /* allocation node */
77   struct desc_str *prev;        /* linked list */
78
79   qset_t *value;
80 } arr_desc_t;
81
82 /* ===================================================
83    Global Prototypes:
84    =================================================== */
85 /* Dump all names to a file of the given name */
86 void pto_dump_names (const char*);
87
88 /* Find the given descriptor's entry for the given entity */
89 qset_t *get_entry (desc_t*, entity*);
90
91 /* get a new descriptor for the given type at the given node */
92 desc_t *new_name (ir_type*, ir_node*, int);
93
94 /* get a new descriptor for the given (presumably static) entity */
95 desc_t *new_ent_name (entity*);
96
97 /* Initialise the name module */
98 void pto_name_init (void);
99
100 /* Cleanup the name module */
101 void pto_name_cleanup (void);
102
103 /* ===================================================
104    Global Variables:
105    =================================================== */
106
107
108 # endif /* not defined _PTO_NAME_ */
109
110
111 \f
112 /*
113   $Log$
114   Revision 1.7  2006/01/13 22:00:15  beck
115   renamed all types 'type' to 'ir_type'
116
117   Revision 1.6  2004/12/15 13:30:41  liekweg
118   print yet nicer names
119
120   Revision 1.5  2004/12/06 12:52:09  liekweg
121   colorize name dump
122
123   Revision 1.4  2004/11/30 15:49:27  liekweg
124   include 'dump'
125
126   Revision 1.3  2004/11/30 14:47:54  liekweg
127   fix initialisation; do correct iteration
128
129   Revision 1.2  2004/11/24 14:53:56  liekweg
130   Bugfixes
131
132   Revision 1.1  2004/11/18 16:37:34  liekweg
133   rewritten
134
135
136 */