projects
/
cparser
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
support for pointer add/sub, no need for type_environment in ast2firm
[cparser]
/
type_t.h
diff --git
a/type_t.h
b/type_t.h
index
17b90e1
..
de76857
100644
(file)
--- a/
type_t.h
+++ b/
type_t.h
@@
-3,6
+3,8
@@
#include <stdbool.h>
#include <stdbool.h>
+#include <libfirm/firm_types.h>
+
#include "type.h"
#include "symbol.h"
#include "token_t.h"
#include "type.h"
#include "symbol.h"
#include "token_t.h"
@@
-17,7
+19,7
@@
typedef enum {
TYPE_COMPOUND_STRUCT,
TYPE_COMPOUND_UNION,
TYPE_ENUM,
TYPE_COMPOUND_STRUCT,
TYPE_COMPOUND_UNION,
TYPE_ENUM,
- TYPE_
METHOD
,
+ TYPE_
FUNCTION
,
TYPE_POINTER,
TYPE_ARRAY,
TYPE_BUILTIN,
TYPE_POINTER,
TYPE_ARRAY,
TYPE_BUILTIN,
@@
-25,8
+27,10
@@
typedef enum {
TYPE_TYPEOF
} type_type_t;
TYPE_TYPEOF
} type_type_t;
+/* note that the constant values represent the rank of the types as defined
+ * in ยง 6.3.1 */
typedef enum {
typedef enum {
- ATOMIC_TYPE_INVALID,
+ ATOMIC_TYPE_INVALID
= 0
,
ATOMIC_TYPE_VOID,
ATOMIC_TYPE_CHAR,
ATOMIC_TYPE_SCHAR,
ATOMIC_TYPE_VOID,
ATOMIC_TYPE_CHAR,
ATOMIC_TYPE_SCHAR,
@@
-65,6
+69,8
@@
typedef enum {
struct type_t {
type_type_t type;
type_qualifier_t qualifiers;
struct type_t {
type_type_t type;
type_qualifier_t qualifiers;
+
+ ir_type *firm_type;
};
struct atomic_type_t {
};
struct atomic_type_t {
@@
-75,6
+81,7
@@
struct atomic_type_t {
struct builtin_type_t {
type_t type;
symbol_t *symbol;
struct builtin_type_t {
type_t type;
symbol_t *symbol;
+ type_t *real_type;
};
struct pointer_type_t {
};
struct pointer_type_t {
@@
-90,17
+97,17
@@
struct array_type_t {
expression_t *size;
};
expression_t *size;
};
-struct
method
_parameter_t {
- type_t *type;
-
method
_parameter_t *next;
+struct
function
_parameter_t {
+ type_t
*type;
+
function
_parameter_t *next;
};
};
-struct
method
_type_t {
- type_t type;
- type_t *result_type;
-
method
_parameter_t *parameters;
- bool variadic;
- bool unspecified_parameters;
+struct
function
_type_t {
+ type_t
type;
+ type_t
*result_type;
+
function
_parameter_t *parameters;
+ bool
variadic;
+ bool
unspecified_parameters;
};
struct compound_type_t {
};
struct compound_type_t {