X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=types.c;h=a9ef574536843e37df8444420f806c8dab022e12;hb=bf92df408b5fef01d5ee065b02c1deb7e4289a5b;hp=0f252455d761a16ffc2a090eb62fd40858e74909;hpb=6d7d61de445629e1590d3a2ba2990ef7a651368a;p=cparser diff --git a/types.c b/types.c index 0f25245..a9ef574 100644 --- a/types.c +++ b/types.c @@ -44,7 +44,9 @@ type_t *type_unsigned_long; type_t *type_void; type_t *type_char_ptr; +type_t *type_char_ptr_restrict; type_t *type_const_char_ptr; +type_t *type_const_char_ptr_restrict; type_t *type_int_ptr; type_t *type_long_long_ptr; type_t *type_long_ptr; @@ -52,6 +54,10 @@ type_t *type_unsigned_long_ptr; type_t *type_short_ptr; type_t *type_signed_char_ptr; type_t *type_void_ptr; +type_t *type_const_void; +type_t *type_const_void_ptr; +type_t *type_void_ptr_restrict; +type_t *type_const_void_ptr_restrict; type_t *type_char_ptr_ptr; @@ -117,6 +123,7 @@ void init_basic_types(void) type_float = make_atomic_type(ATOMIC_TYPE_FLOAT, TYPE_QUALIFIER_NONE); type_char = make_atomic_type(ATOMIC_TYPE_CHAR, TYPE_QUALIFIER_NONE); type_void = make_atomic_type(ATOMIC_TYPE_VOID, TYPE_QUALIFIER_NONE); + type_const_void = make_atomic_type(ATOMIC_TYPE_VOID, TYPE_QUALIFIER_CONST); /* microsoft types */ if (c_mode & _MS) { @@ -143,7 +150,12 @@ void init_basic_types(void) /* pointer types */ type_void_ptr = make_pointer_type(type_void, TYPE_QUALIFIER_NONE); + type_const_void_ptr = make_pointer_type(type_const_void, TYPE_QUALIFIER_NONE); + type_void_ptr_restrict = make_pointer_type(type_void, TYPE_QUALIFIER_RESTRICT); + type_const_void_ptr_restrict + = make_pointer_type(type_const_void, TYPE_QUALIFIER_RESTRICT); type_char_ptr = make_pointer_type(type_char, TYPE_QUALIFIER_NONE); + type_char_ptr_restrict = make_pointer_type(type_char, TYPE_QUALIFIER_RESTRICT); type_signed_char_ptr = make_pointer_type(type_signed_char, TYPE_QUALIFIER_NONE); type_short_ptr = make_pointer_type(type_short, TYPE_QUALIFIER_NONE); type_int_ptr = make_pointer_type(type_int, TYPE_QUALIFIER_NONE); @@ -152,10 +164,12 @@ void init_basic_types(void) type_long_long_ptr = make_pointer_type(type_long_long, TYPE_QUALIFIER_NONE); type_char_ptr_ptr = make_pointer_type(type_char_ptr, TYPE_QUALIFIER_NONE); + type_valist = type_void_ptr; /* const character types */ type_const_char = make_atomic_type(ATOMIC_TYPE_CHAR, TYPE_QUALIFIER_CONST); type_const_char_ptr = make_pointer_type(type_const_char, TYPE_QUALIFIER_NONE); + type_const_char_ptr_restrict = make_pointer_type(type_const_char, TYPE_QUALIFIER_RESTRICT); /* other types */ type_intmax_t = type_long_long;