*** empty log message ***
[libfirm] / ir / tr / tpop.h
1
2 # ifndef _TYPEOP_H_
3 # define _TYPEOP_H_
4
5 #include "ident.h"
6
7 /****h* libfirm/tpop
8  *
9  * NAME
10  *  file tpop.h
11  * COPYRIGHT
12  *   (C) 2001 by Universitaet Karlsruhe
13  * AUTHORS
14  *   Goetz Lindenmaier
15  * NOTES
16  *  This module specifies the kinds of types available in firm.  They are
17  *  called type opcodes. These include classes, structs, methods, unions,
18  *  arrays, enumerations, pointers and primitive types.
19  *****
20  */
21
22 /****** tpop/typecode
23  *
24  * NAME
25  *   typecode -- an enum for the type kinds
26  * PURPOSE
27  *   For each type kind exists a typecode to identify it.
28  * SOURCE
29  */
30 typedef enum {
31   tpo_class,
32   tpo_struct,
33   tpo_method,
34   tpo_union,
35   tpo_array,
36   tpo_enumeration,
37   tpo_pointer,
38   tpo_primitive
39 } tp_opcode;
40 /******/
41
42 /****s* tpop/tp_op
43  *
44  * NAME
45  *   tp_op  - a structure containing information about a kind of type.
46  * PURPOSE
47  *   A structure containing information about a kind of type.  So far
48  *   this is only the kind name, an enum for case-switching and some
49  *   internal values.
50  * SEE ALSO
51  *   get_tpop_name, get_tpop_code, get_tpop_ident
52  * SOURCE
53  */
54 typedef struct tp_op tp_op;
55 /******/
56
57
58 /****f* tpop/get_tpop_name
59  *
60  * NAME
61  *   get_tpop_name - Returns the string for the type opcode.
62  * SYNOPSIS
63  *   const char *get_tpop_name (tp_op *op)
64  * INPUTS
65  *   op - The type opcode to get the string from.
66  * RESULT
67  *   a string.  (@@@ Null terminated???)
68  ***
69  */
70 const char *get_tpop_name (tp_op *op);
71
72 /****f* tpop/get_tpop_code
73  *
74  * NAME
75  *   get_tpop_code - Returns an enum for the type opcode.
76  * SYNOPSIS
77  *   tp_opcode get_tpop_code (tp_op *op);
78  * INPUTS
79  *   op - The type opcode to get the enum from.
80  * RESULT
81  *   the enum.
82  ***
83  */
84 tp_opcode get_tpop_code (tp_op *op);
85
86 /****f* tpop/get_tpop_ident
87  *
88  * NAME
89  *   get_tpop_ident - Returns the ident for the type opcode.
90  * SYNOPSIS
91  *   ident *get_tpop_ident (tp_op *op);
92  * INPUTS
93  *   op - The type opcode to get the ident from.
94  * RESULT
95  *   The ident.
96  ***
97  */
98 ident *get_tpop_ident (tp_op *op);
99
100 /****d* tpop/type_class
101  *
102  * NAME
103  *   type_class  -
104  * PURPOSE
105  *   This type opcode marks that the corresponding type is a class type.
106  *   Consequently the type refers to supertypes, subtypes and entities.
107  *   Entities can be any fields, but also methods.
108  *   @@@ value class or not???
109  * NOTES
110  *   This struct is dynamically allocated but constant for the lifetime
111  *   of the library.
112  * SOURCE
113  */
114 extern tp_op *type_class;
115 /******/
116
117 /****d* tpop/type_struct
118  *
119  * NAME
120  *   type_struct
121  * PURPOSE
122  *   This type opcode marks that the corresponding type is a compound type
123  *   as a struct in C.  Consequently the type refers to a list of entities
124  *   which may not be methods (but pointers to methods).
125  * NOTES
126  *   This struct is dynamically allocated but constant for the lifetime
127  *   of the library.
128  * SOURCE
129  */
130 extern tp_op *type_struct;
131 /******/
132
133 /****d* tpop/type_method
134  *
135  * NAME
136  *   type_method
137  * PURPOSE
138  *   This type opcode marks that the corresponding type is a method type.
139  *   Consequently it refers to a list of arguments and results.
140  * NOTES
141  *   This struct is dynamically allocated but constant for the lifetime
142  *   of the library.
143  * SOURCE
144  */
145 extern tp_op *type_method;
146 /******/
147
148 /****d* tpop/type_union
149  *
150  * NAME
151  *   type_union
152  * PURPOSE
153  *   This type opcode marks that the corresponding type is a union type.
154  *   Consequently it refers to a list of unioned types.
155  * NOTES
156  *   This struct is dynamically allocated but constant for the lifetime
157  *   of the library.
158  * SOURCE
159  */
160 extern tp_op *type_union;
161 /******/
162
163 /****d* tpop/type_array
164  *
165  * NAME
166  *   type_array
167  * PURPOSE
168  *   This type opcode marks that the corresponding type is an array type.
169  *   Consequently it contains a list of dimensions (lower and upper bounds)
170  *   and an element type.
171  * NOTES
172  *   This struct is dynamically allocated but constant for the lifetime
173  *   of the library.
174  * SOURCE
175  */
176 extern tp_op *type_array;
177 /******/
178
179 /****d* tpop/type_enumeration
180  *
181  * NAME
182  *   type_enumeration
183  * PURPOSE
184  *   This type opcode marks that the corresponding type is an enumeration type.
185  *   Consequently it contains a list of idents for the enumeration identifiers
186  *   and a list of tarbet values that are the constants used to implement
187  *   the enumerators.
188  * NOTES
189  *   This struct is dynamically allocated but constant for the lifetime
190  *   of the library.
191  * SOURCE
192  */
193 extern tp_op *type_enumeration;
194 /******/
195
196 /****d* tpop/type_pointer
197  *
198  * NAME
199  *   type_pointer
200  * PURPOSE
201  *   This type opcode marks that the corresponding type is a pointer type.
202  *   It contains a reference to the type the pointer points to.
203  * NOTES
204  *   This struct is dynamically allocated but constant for the lifetime
205  *   of the library.
206  * SOURCE
207  */
208 extern tp_op *type_pointer;
209 /******/
210
211 /****d* tpop/type_primitive
212  *
213  * NAME
214  *   type_primitive
215  * PURPOSE
216  *   This type opcode marks that the corresponding type is a primitive type.
217  *   Primitive types are types that are directly mapped to target machine
218  *   modes.
219  * NOTES
220  *   This struct is dynamically allocated but constant for the lifetime
221  *   of the library.
222  * SOURCE
223  */
224 extern tp_op *type_primitive;
225 /******/
226
227 # endif /*_TYPEOP_H_ */