compound const entity stuff
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 14 Aug 2003 15:07:33 +0000 (15:07 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 14 Aug 2003 15:07:33 +0000 (15:07 +0000)
[r1681]

ir/tr/entity.c
ir/tr/entity.h

index 0d61955..3b3984b 100644 (file)
@@ -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);
 }
index 8f312ac..0544c70 100644 (file)
@@ -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);