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);
}
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);