From: Götz Lindenmaier Date: Thu, 14 Aug 2003 15:07:33 +0000 (+0000) Subject: compound const entity stuff X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=da2c6e43b73380864705d6b42b3b1720da860f06;p=libfirm compound const entity stuff [r1681] --- diff --git a/ir/tr/entity.c b/ir/tr/entity.c index 0d61955eb..3b3984bfe 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -602,14 +602,14 @@ get_compound_ent_value_member(entity *ent, int pos) { path = get_compound_ent_value_path(ent, pos); assert(path->len == 1); - return get_compound_graph_path_node(path, 0); + return get_compound_graph_path_node(path, get_compound_graph_path_length(path)-1); } INLINE void set_compound_ent_value(entity *ent, ir_node *val, entity *member, int pos) { compound_graph_path *path; assert(ent && is_compound_entity(ent) && (ent->variability != uninitialized)); - path = new_compound_graph_path(get_entity_owner(ent), 1); + path = get_compound_ent_value_path(ent, pos); set_compound_graph_path_node(path, 0, member); set_compound_ent_value_w_path(ent, val, path, pos); } diff --git a/ir/tr/entity.h b/ir/tr/entity.h index 8f312ac5a..0544c7032 100644 --- a/ir/tr/entity.h +++ b/ir/tr/entity.h @@ -357,8 +357,11 @@ void remove_compound_ent_value(entity *ent, entity *value_ent); direct, atomic member of the constant entities type. In this case the corresponding entity can be accessed directly. The following functions allow direct access. */ +/* generates a Path with length 1 */ void add_compound_ent_value(entity *ent, ir_node *val, entity *member); +/* Returns the last member in the path */ entity *get_compound_ent_value_member(entity *ent, int pos); +/* Sets the path at pos 0 */ void set_compound_ent_value(entity *ent, ir_node *val, entity *member, int pos);