Commit 30c84b27 authored by Andreas Zwinkau's avatar Andreas Zwinkau
Browse files

Remove type lower functions from API

* get_associated_type is unnecessary
* is_lowered_type is an internal inline function now
* set_lowered_type is an internal inline function now
parent dbff2141
......@@ -2100,11 +2100,6 @@ FIRM_API int is_frame_type(const ir_type *tp);
*/
FIRM_API int is_value_param_type(const ir_type *tp);
/**
* Checks, whether a type is a lowered type.
*/
FIRM_API int is_lowered_type(const ir_type *tp);
/**
* Makes a new value type. Value types are struct types,
* so all struct access functions work.
......@@ -2126,18 +2121,6 @@ FIRM_API ir_type *new_type_frame(void);
*/
FIRM_API ir_type *clone_frame_type(ir_type *type);
/**
* Sets a lowered type for a type. This sets both associations
* and marks lowered_type as a "lowered" one.
*/
FIRM_API void set_lowered_type(ir_type *tp, ir_type *lowered_type);
/**
* Gets the lowered/unlowered type of a type or NULL if this type
* has no lowered/unlowered one.
*/
FIRM_API ir_type *get_associated_type(const ir_type *tp);
/**
* Allocate an area of size bytes aligned at alignment
* at the start or the end of a frame type.
......
......@@ -2045,11 +2045,6 @@ int is_value_param_type(const ir_type *tp)
return tp->flags & tf_value_param_type;
}
int is_lowered_type(const ir_type *tp)
{
return tp->flags & tf_lowered_type;
}
ir_type *new_type_value(void)
{
ir_type *res = new_type_struct(new_id_from_str("<value_type>"));
......@@ -2096,23 +2091,6 @@ ir_type *clone_frame_type(ir_type *type)
return res;
}
void set_lowered_type(ir_type *tp, ir_type *lowered_type)
{
assert(is_type(tp) && is_type(lowered_type));
lowered_type->flags |= tf_lowered_type;
/* there might be a chain of lowerings, get to the start */
while (is_lowered_type(tp)) {
tp = tp->assoc_type;
}
tp->assoc_type = lowered_type;
lowered_type->assoc_type = tp;
}
ir_type *get_associated_type(const ir_type *tp)
{
return tp->assoc_type;
}
void set_default_size(ir_type *tp, unsigned size)
{
tp->size = size;
......
......@@ -308,6 +308,11 @@ static inline void _set_master_type_visited(ir_visited_t val) { firm_type_visite
static inline ir_visited_t _get_master_type_visited(void) { return firm_type_visited; }
static inline void _inc_master_type_visited(void) { ++firm_type_visited; }
static inline int is_lowered_type(const ir_type *tp)
{
return tp->flags & tf_lowered_type;
}
static inline ir_type *get_type_unlowered(const ir_type *tp)
{
assert (is_lowered_type(tp));
......@@ -320,6 +325,17 @@ static inline ir_type *get_type_lowered(const ir_type *tp)
return tp->assoc_type;
}
static inline void set_lowered_type(ir_type *tp, ir_type *lowered_type)
{
assert (is_type(tp) && is_type(lowered_type));
lowered_type->flags |= tf_lowered_type;
/* there might be a chain of lowerings, get to the start */
while (is_lowered_type(tp)) {
tp = tp->assoc_type;
}
tp->assoc_type = lowered_type;
lowered_type->assoc_type = tp;
}
static inline void *_get_type_link(const ir_type *tp)
{
......
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