6 #include <libfirm/firm_types.h>
14 struct obstack *type_obst;
30 /* note that the constant values represent the rank of the types as defined
33 ATOMIC_TYPE_INVALID = 0,
45 ATOMIC_TYPE_ULONGLONG,
48 ATOMIC_TYPE_LONG_DOUBLE,
50 #ifdef PROVIDE_COMPLEX
51 ATOMIC_TYPE_FLOAT_COMPLEX,
52 ATOMIC_TYPE_DOUBLE_COMPLEX,
53 ATOMIC_TYPE_LONG_DOUBLE_COMPLEX,
54 ATOMIC_TYPE_FLOAT_IMAGINARY,
55 ATOMIC_TYPE_DOUBLE_IMAGINARY,
56 ATOMIC_TYPE_LONG_DOUBLE_IMAGINARY,
61 TYPE_QUALIFIER_NONE = 0,
62 TYPE_QUALIFIER_CONST = 1 << 0,
63 TYPE_QUALIFIER_RESTRICT = 1 << 1,
64 TYPE_QUALIFIER_VOLATILE = 1 << 2,
67 typedef unsigned int type_qualifiers_t;
69 struct function_parameter_t {
71 function_parameter_t *next;
76 type_qualifiers_t qualifiers;
79 /* if type == TYPE_ATOMIC */
81 atomic_type_type_t atype;
83 /* if type == TYPE_COMPOUND_STRUCT or type == TYPE_COMPOUND_UNION */
85 /** the declaration of the compound type, its context field
86 * contains the compound entries. */
87 declaration_t *declaration;
89 /* if type == TYPE_ENUM */
91 /** the declaration of the enum type. You can find the enum entries by
92 * walking the declaration->next list until you don't find
93 * STORAGE_CLASS_ENUM_ENTRY declarations anymore */
94 declaration_t *declaration;
96 /* if type == TYPE_FUNCTION */
99 function_parameter_t *parameters;
101 bool unspecified_parameters;
103 /* if type == TYPE_POINTER */
107 /* if type == TYPE_ARRAY */
109 type_t *element_type;
114 /* if type == TYPE_BUILTIN */
119 /* if type == TYPE_TYPEDEF */
121 declaration_t *declaration;
122 type_t *resolved_type;
124 /* if type == TYPE_TYPEOF */
126 expression_t *expression;
128 type_t *resolved_type;
135 type_t *make_atomic_type(atomic_type_type_t type, type_qualifiers_t qualifiers);
136 type_t *make_pointer_type(type_t *points_to, type_qualifiers_t qualifiers);