X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type_t.h;h=b0c21ac41c31779dfe46a49f3b93f2dd66d8d5be;hb=2fb66fd8bd2a5956ab2cad26978ccfb7e105d45f;hp=63b04b1fd88b3dd7c8fcd362803bbe1de307ef21;hpb=1a47a352dc074585e56b11a6e1e693e8ece6b5be;p=cparser diff --git a/type_t.h b/type_t.h index 63b04b1..b0c21ac 100644 --- a/type_t.h +++ b/type_t.h @@ -201,7 +201,16 @@ type_t *make_array_type(type_t *element_type, size_t size, type_qualifiers_t qualifiers); function_parameter_t *allocate_parameter(type_t*); +/** + * Duplicates a type. + * + * @param type The type to copy. + * @return A copy of the type. + * + * @note This does not produce a deep copy! + */ type_t *duplicate_type(const type_t *type); + type_t *identify_new_type(type_t *type); static inline bool is_typeref(const type_t *type) @@ -220,6 +229,11 @@ static inline bool is_type_atomic(const type_t *type, atomic_type_kind_t atype) return atomic_type->akind == atype; } +static inline bool is_type_void(type_t const *const type) +{ + return is_type_atomic(type, ATOMIC_TYPE_VOID); +} + static inline bool is_type_pointer(const type_t *type) { assert(!is_typeref(type));