ast2firm: Factorise code to convert a value to its storage type.
[cparser] / type_t.h
index 63b04b1..b0c21ac 100644 (file)
--- 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));