From: Götz Lindenmaier Date: Thu, 20 Nov 2003 14:22:17 +0000 (+0000) Subject: new accesss routines X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=5379d64080fb35f6cfd1553e0c8e93f0090f96c2;p=libfirm new accesss routines [r2065] --- diff --git a/ir/tr/type.c b/ir/tr/type.c index 7132fc5e9..6f66c9b39 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -745,6 +745,14 @@ void remove_class_supertype(type *clss, type *supertype) { } } +char *get_peculiarity_string(peculiarity p) { + if (p == peculiarity_description) + return "peculiarity_description"; + if (p == peculiarity_inherited) + return "peculiarity_inherited"; + return "peculiarity_existent"; +} + INLINE peculiarity get_class_peculiarity (type *clss) { assert(clss && (clss->type_op == type_class)); return clss->attr.ca.peculiarity; @@ -925,11 +933,18 @@ entity *get_method_value_param_ent(type *method, int pos) { method->attr.ma.value_params = build_value_type(mangle_u(get_type_ident(method), value_params_suffix), get_method_n_params(method), method->attr.ma.param_type); - assert((get_entity_type(get_struct_member(method->attr.ma.value_params, pos)) != method->attr.ma.value_params) + assert((get_entity_type(get_struct_member(method->attr.ma.value_params, pos)) + != method->attr.ma.value_params) && "param type not yet set"); return get_struct_member(method->attr.ma.value_params, pos); } +type *get_method_value_res_type(type *method) { + assert(method && (method->type_op == type_method)); + return method->attr.ma.value_params; +} + + int get_method_n_ress (type *method) { assert(method && (method->type_op == type_method)); return method->attr.ma.n_res; diff --git a/ir/tr/type.h b/ir/tr/type.h index 7edb03369..33fe124a8 100644 --- a/ir/tr/type.h +++ b/ir/tr/type.h @@ -408,9 +408,11 @@ typedef enum peculiarity { Overwrites must refer to at least one other entity. If this is a method entity there exists no irg for this entity, only for one of the - overwritten ones. */ + overwritten ones. + Only for entity. */ peculiarity_existent /**< The entity/type (can) exist. */ } peculiarity; +char *get_peculiarity_string(peculiarity p); /* The peculiarity of the class. The enumeration peculiarity is defined in entity.h */ @@ -546,6 +548,9 @@ void set_method_res_type(type *method, int pos, type* tp); /* Returns an entity that represents the copied value result. Only necessary for compounds passed by value. This information is constructed only on demand. */ entity *get_method_value_res_ent(type *method, int pos); +/* + */ +type *get_method_value_res_type(type *method); /** * this enum flags the variadicity of methods (methods with a