Commit 9ddf1370 authored by Matthias Braun's avatar Matthias Braun
Browse files

add function to check if a type is a segment

parent 08da5b1f
......@@ -1119,6 +1119,12 @@ FIRM_API int is_type(const void *thing);
*/
FIRM_API long get_type_nr(const ir_type *tp);
/**
* Returns true if a type is a segment type.
* A segment type is one of the global types returned by get_segment_type().
*/
FIRM_API int is_segment_type(const ir_type *tp);
/**
* @ingroup compound_type
* @defgroup class_type Class
......
......@@ -1037,6 +1037,11 @@ ir_type *new_type_segment(ident *const name, type_flags const flags)
return seg;
}
int is_segment_type(const ir_type *type)
{
return (type->flags & tf_segment) != 0;
}
ir_type *new_type_array(size_t n_dimensions, ir_type *element_type)
{
assert(!is_Method_type(element_type));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment