12 * (C) 2001 by Universitaet Karlsruhe
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.
25 * typecode -- an enum for the type kinds
27 * For each type kind exists a typecode to identify it.
46 * tp_op - a structure containing information about a kind of type.
48 * A structure containing information about a kind of type. So far
49 * this is only the kind name, an enum for case-switching and some
52 * get_tpop_name, get_tpop_code, get_tpop_ident
55 typedef struct tp_op tp_op;
59 /****f* tpop/get_tpop_name
62 * get_tpop_name - Returns the string for the type opcode.
64 * const char *get_tpop_name (tp_op *op)
66 * op - The type opcode to get the string from.
68 * a string. (@@@ Null terminated???)
71 const char *get_tpop_name (tp_op *op);
73 /****f* tpop/get_tpop_code
76 * get_tpop_code - Returns an enum for the type opcode.
78 * tp_opcode get_tpop_code (tp_op *op);
80 * op - The type opcode to get the enum from.
85 tp_opcode get_tpop_code (tp_op *op);
87 /****f* tpop/get_tpop_ident
90 * get_tpop_ident - Returns the ident for the type opcode.
92 * ident *get_tpop_ident (tp_op *op);
94 * op - The type opcode to get the ident from.
99 ident *get_tpop_ident (tp_op *op);
101 /****d* tpop/type_class
106 * This type opcode marks that the corresponding type is a class type.
107 * Consequently the type refers to supertypes, subtypes and entities.
108 * Entities can be any fields, but also methods.
109 * @@@ value class or not???
111 * This struct is dynamically allocated but constant for the lifetime
115 extern tp_op *type_class;
118 /****d* tpop/type_struct
123 * This type opcode marks that the corresponding type is a compound type
124 * as a struct in C. Consequently the type refers to a list of entities
125 * which may not be methods (but pointers to methods).
127 * This struct is dynamically allocated but constant for the lifetime
131 extern tp_op *type_struct;
134 /****d* tpop/type_method
139 * This type opcode marks that the corresponding type is a method type.
140 * Consequently it refers to a list of arguments and results.
142 * This struct is dynamically allocated but constant for the lifetime
146 extern tp_op *type_method;
149 /****d* tpop/type_union
154 * This type opcode marks that the corresponding type is a union type.
155 * Consequently it refers to a list of unioned types.
157 * This struct is dynamically allocated but constant for the lifetime
161 extern tp_op *type_union;
164 /****d* tpop/type_array
169 * This type opcode marks that the corresponding type is an array type.
170 * Consequently it contains a list of dimensions (lower and upper bounds)
171 * and an element type.
173 * This struct is dynamically allocated but constant for the lifetime
177 extern tp_op *type_array;
180 /****d* tpop/type_enumeration
185 * This type opcode marks that the corresponding type is an enumeration type.
186 * Consequently it contains a list of idents for the enumeration identifiers
187 * and a list of tarbet values that are the constants used to implement
190 * This struct is dynamically allocated but constant for the lifetime
194 extern tp_op *type_enumeration;
197 /****d* tpop/type_pointer
202 * This type opcode marks that the corresponding type is a pointer type.
203 * It contains a reference to the type the pointer points to.
205 * This struct is dynamically allocated but constant for the lifetime
209 extern tp_op *type_pointer;
212 /****d* tpop/type_primitive
217 * This type opcode marks that the corresponding type is a primitive type.
218 * Primitive types are types that are directly mapped to target machine
221 * This struct is dynamically allocated but constant for the lifetime
225 extern tp_op *type_primitive;
233 * This type opcode is an auxiliary opcode dedicated to support transformations
234 * of the type structure. If a type is changed to another type with another
235 * opcode the new type will be allocated with new memory. All nodes refereing
236 * to the old type need to be changed to refer the new one. This is simplified
237 * by turning the old type into an id type that merely forwards to the new type
238 * that now replaces the old one.
239 * type_ids should never be visible out of the type module. All access routines
240 * should automatically check for type_id and eventually follow the forward in
241 * type_id. Two types are exchanged by a call to exchange_types.
242 * If a type_id is visible externally report this as bug. If it is assured that
243 * this never happens this extern variable can be moved to type_t.h.
245 * This struct is dynamically allocated but constant for the lifetime
249 extern tp_op *type_id;
252 # endif /*_TYPEOP_H_ */