Commit b4116a3d authored by Boris Boesler's avatar Boris Boesler
Browse files

added functions set_type_link and get_type_link

[r230]
parent b636c7a7
......@@ -59,6 +59,7 @@ new_type(tp_op *type_op, ir_mode *mode, ident* name) {
res->state = layout_undefined;
res->size = -1;
res->visit = 0;
res -> link = NULL;
return res;
}
......@@ -77,6 +78,19 @@ void free_type_attrs(type *tp) {
}
}
/* set/get the link field */
void *get_type_link(type *tp)
{
assert(tp);
return(tp -> link);
}
void set_type_link(type *tp, void *l)
{
assert(tp);
tp -> link = l;
}
tp_op* get_type_tpop(type *tp) {
assert(tp);
return tp->type_op;
......@@ -250,6 +264,7 @@ void remove_class_subtype(type *clss, type *subtype) {
void add_class_supertype (type *clss, type *supertype) {
assert(clss && (clss->type_op == type_class));
assert(supertype && (supertype -> type_op == type_class));
ARR_APP1 (type *, clss->attr.ca.supertypes, supertype);
ARR_APP1 (type *, supertype->attr.ca.subtypes, clss);
}
......
......@@ -92,6 +92,8 @@ typedef struct ir_node ir_node;
*/
typedef struct type type;
void* get_type_link(type *tp);
void set_type_link(type *tp, void *l);
tp_op* get_type_tpop(type *tp);
ident* get_type_tpop_nameid(type *tp);
const char* get_type_tpop_name(type *tp);
......
......@@ -103,6 +103,7 @@ struct type {
when fixing the layout of this class. Size must be
given in bytes. */
unsigned long visit; /* visited counter for walks of the type information */
void *link; /* holds temporary data - like in irnode_t.h */
tp_attr attr; /* type kind specific fields. This must be the last
entry in this struct! Varying size! */
};
......
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