14 * (C) 2001 by Universitaet Karlsruhe
18 * This module specifies the kinds of types available in firm. They are
19 * called type opcodes. These include classes, structs, methods, unions,
20 * arrays, enumerations, pointers and primitive types.
27 * typecode -- an enum for the type kinds
29 * For each type kind exists a typecode to identify it.
48 * tp_op - a structure containing information about a kind of type.
50 * A structure containing information about a kind of type. So far
51 * this is only the kind name, an enum for case-switching and some
54 * get_tpop_name, get_tpop_code, get_tpop_ident
57 typedef struct tp_op tp_op;
61 /****f* tpop/get_tpop_name
64 * get_tpop_name - Returns the string for the type opcode.
66 * const char *get_tpop_name (tp_op *op)
68 * op - The type opcode to get the string from.
70 * a string. (@@@ Null terminated???)
73 const char *get_tpop_name (tp_op *op);
75 /****f* tpop/get_tpop_code
78 * get_tpop_code - Returns an enum for the type opcode.
80 * tp_opcode get_tpop_code (tp_op *op);
82 * op - The type opcode to get the enum from.
87 tp_opcode get_tpop_code (tp_op *op);
89 /****f* tpop/get_tpop_ident
92 * get_tpop_ident - Returns the ident for the type opcode.
94 * ident *get_tpop_ident (tp_op *op);
96 * op - The type opcode to get the ident from.
101 ident *get_tpop_ident (tp_op *op);
103 /****d* tpop/type_class
108 * This type opcode marks that the corresponding type is a class type.
109 * Consequently the type refers to supertypes, subtypes and entities.
110 * Entities can be any fields, but also methods.
111 * @@@ value class or not???
113 * This struct is dynamically allocated but constant for the lifetime
117 extern tp_op *type_class;
120 /****d* tpop/type_struct
125 * This type opcode marks that the corresponding type is a compound type
126 * as a struct in C. Consequently the type refers to a list of entities
127 * which may not be methods (but pointers to methods).
129 * This struct is dynamically allocated but constant for the lifetime
133 extern tp_op *type_struct;
136 /****d* tpop/type_method
141 * This type opcode marks that the corresponding type is a method type.
142 * Consequently it refers to a list of arguments and results.
144 * This struct is dynamically allocated but constant for the lifetime
148 extern tp_op *type_method;
151 /****d* tpop/type_union
156 * This type opcode marks that the corresponding type is a union type.
157 * Consequently it refers to a list of unioned types.
159 * This struct is dynamically allocated but constant for the lifetime
163 extern tp_op *type_union;
166 /****d* tpop/type_array
171 * This type opcode marks that the corresponding type is an array type.
172 * Consequently it contains a list of dimensions (lower and upper bounds)
173 * and an element type.
175 * This struct is dynamically allocated but constant for the lifetime
179 extern tp_op *type_array;
182 /****d* tpop/type_enumeration
187 * This type opcode marks that the corresponding type is an enumeration type.
188 * Consequently it contains a list of idents for the enumeration identifiers
189 * and a list of tarbet values that are the constants used to implement
192 * This struct is dynamically allocated but constant for the lifetime
196 extern tp_op *type_enumeration;
199 /****d* tpop/type_pointer
204 * This type opcode marks that the corresponding type is a pointer type.
205 * It contains a reference to the type the pointer points to.
207 * This struct is dynamically allocated but constant for the lifetime
211 extern tp_op *type_pointer;
214 /****d* tpop/type_primitive
219 * This type opcode marks that the corresponding type is a primitive type.
220 * Primitive types are types that are directly mapped to target machine
223 * This struct is dynamically allocated but constant for the lifetime
227 extern tp_op *type_primitive;
235 * This type opcode is an auxiliary opcode dedicated to support transformations
236 * of the type structure. If a type is changed to another type with another
237 * opcode the new type will be allocated with new memory. All nodes refering
238 * to the old type need to be changed to refer the new one. This is simplified
239 * by turning the old type into an id type that merely forwards to the new type
240 * that now replaces the old one.
241 * type_ids should never be visible out of the type module. All access routines
242 * should automatically check for type_id and eventually follow the forward in
243 * type_id. Two types are exchanged by a call to exchange_types.
244 * If a type_id is visible externally report this as bug. If it is assured that
245 * this never happens this extern variable can be moved to tpop_t.h.
247 * This struct is dynamically allocated but constant for the lifetime
251 extern tp_op *type_id;
254 # endif /*_TYPEOP_H_ */