12 * (C) 2001 by Universitaet Karlsruhe
14 * This module specifies the kinds of types available in firm. They are
15 * called type opcodes. These include classes, structs, methods, unions,
16 * arrays, enumerations, pointers and primitive types.
21 * - an enum for the type kinds
22 * For each type kind exists a typecode to identify it.
38 * a structure containing information about a kind of type.
39 * A structure containing information about a kind of type. So far
40 * this is only the kind name, an enum for case-switching and some
42 * @see get_tpop_name, get_tpop_code, get_tpop_ident
44 typedef struct tp_op tp_op;
49 * Returns the string for the type opcode.
50 * @param op - The type opcode to get the string from.
51 * @return a string. (@@@ Null terminated???)
54 const char *get_tpop_name (tp_op *op);
58 * Returns an enum for the type opcode.
59 * @param op - The type opcode to get the enum from.
63 tp_opcode get_tpop_code (tp_op *op);
67 * Returns the ident for the type opcode.
68 * @param op - The type opcode to get the ident from.
72 ident *get_tpop_ident (tp_op *op);
77 * This type opcode marks that the corresponding type is a class type.
78 * Consequently the type refers to supertypes, subtypes and entities.
79 * Entities can be any fields, but also methods.
80 * @@@ value class or not???
81 * This struct is dynamically allocated but constant for the lifetime
84 extern tp_op *type_class;
85 tp_op *get_type_class();
90 * This type opcode marks that the corresponding type is a compound type
91 * as a struct in C. Consequently the type refers to a list of entities
92 * which may not be methods (but pointers to methods).
93 * This struct is dynamically allocated but constant for the lifetime
96 extern tp_op *type_struct;
97 tp_op *get_type_struct();
102 * This type opcode marks that the corresponding type is a method type.
103 * Consequently it refers to a list of arguments and results.
104 * This struct is dynamically allocated but constant for the lifetime
107 extern tp_op *type_method;
108 tp_op *get_type_method();
113 * This type opcode marks that the corresponding type is a union type.
114 * Consequently it refers to a list of unioned types.
115 * This struct is dynamically allocated but constant for the lifetime
118 extern tp_op *type_union;
119 tp_op *get_type_union();
124 * This type opcode marks that the corresponding type is an array type.
125 * Consequently it contains a list of dimensions (lower and upper bounds)
126 * and an element type.
127 * This struct is dynamically allocated but constant for the lifetime
130 extern tp_op *type_array;
131 tp_op *get_type_array();
136 * This type opcode marks that the corresponding type is an enumeration type.
137 * Consequently it contains a list of idents for the enumeration identifiers
138 * and a list of tarbet values that are the constants used to implement
140 * This struct is dynamically allocated but constant for the lifetime
143 extern tp_op *type_enumeration;
144 tp_op *get_type_enumeration();
149 * This type opcode marks that the corresponding type is a pointer type.
150 * It contains a reference to the type the pointer points to.
151 * This struct is dynamically allocated but constant for the lifetime
154 extern tp_op *type_pointer;
155 tp_op *get_type_pointer();
160 * This type opcode marks that the corresponding type is a primitive type.
161 * Primitive types are types that are directly mapped to target machine
163 * This struct is dynamically allocated but constant for the lifetime
166 extern tp_op *type_primitive;
167 tp_op *get_type_primitive();
172 * This type opcode is an auxiliary opcode dedicated to support transformations
173 * of the type structure. If a type is changed to another type with another
174 * opcode the new type will be allocated with new memory. All nodes refering
175 * to the old type need to be changed to refer the new one. This is simplified
176 * by turning the old type into an id type that merely forwards to the new type
177 * that now replaces the old one.
178 * type_ids should never be visible out of the type module. All access routines
179 * should automatically check for type_id and eventually follow the forward in
180 * type_id. Two types are exchanged by a call to exchange_types.
181 * If a type_id is visible externally report this as bug. If it is assured that
182 * this never happens this extern variable can be moved to tpop_t.h.
183 * This struct is dynamically allocated but constant for the lifetime
186 extern tp_op *type_id;
187 tp_op *get_type_id();
189 # endif /*_TYPEOP_H_ */