return init_aop_type (ATK_UNION, 0, tag, -1);
}
+const struct aop_type *
+aop_t_enum (const char *tag)
+{
+ if (tag == NULL)
+ fatal_error ("(InterAspect) Must supply a non-NULL tag when specifying an"
+ " enum type.");
+
+ return init_aop_type (ATK_ENUM, 0, tag, -1);
+}
+
/**
* Return a type that will match pointers to the specified type.
*
static bool
does_custom_type_match (tree gcc_type, enum aop_tykind kind, const char *tag)
{
- aop_assert (kind == ATK_STRUCT || kind == ATK_UNION);
+ aop_assert (kind == ATK_STRUCT || kind == ATK_UNION || kind == ATK_ENUM);
if ((kind == ATK_STRUCT && TREE_CODE (gcc_type) == RECORD_TYPE)
- || (kind == ATK_UNION && TREE_CODE (gcc_type) == UNION_TYPE))
+ || (kind == ATK_UNION && TREE_CODE (gcc_type) == UNION_TYPE)
+ || (kind == ATK_ENUM && TREE_CODE (gcc_type) == ENUMERAL_TYPE))
{
aop_assert (tag != NULL);
return safe_str_equal (tag, get_type_name (gcc_type));
return does_fp_type_match (gcc_type, aop_type->size);
case ATK_STRUCT:
case ATK_UNION:
+ case ATK_ENUM:
return does_custom_type_match (gcc_type, aop_type->kind, aop_type->tag);
default:
aop_assert (0);
extern const struct aop_type *aop_t_float128 ();
extern const struct aop_type *aop_t_struct (const char *tag);
extern const struct aop_type *aop_t_union (const char *tag);
+extern const struct aop_type *aop_t_enum (const char *tag);
extern const struct aop_type *aop_t_pointer_to (const struct aop_type *type);
extern void aop_register_pass (const char *pass_name, pass_callback callback);