return gr->tp;
}
-void add_compound_ent_value_w_path(ir_entity *ent, ir_node *val,
- compound_graph_path *path)
+static void allocate_values(ir_entity *ent)
{
- assert(is_compound_entity(ent));
- assert(is_compound_graph_path(path));
if (ent->attr.cmpd_attr.values == NULL) {
ent->attr.cmpd_attr.values = NEW_ARR_F(ir_node*, 0);
assert(ent->attr.cmpd_attr.val_paths == NULL);
ent->attr.cmpd_attr.val_paths = NEW_ARR_F(compound_graph_path*, 0);
}
+}
+
+void add_compound_ent_value_w_path(ir_entity *ent, ir_node *val,
+ compound_graph_path *path)
+{
+ assert(is_compound_entity(ent));
+ assert(is_compound_graph_path(path));
+ allocate_values(ent);
ARR_APP1(ir_node *, ent->attr.cmpd_attr.values, val);
ARR_APP1(compound_graph_path *, ent->attr.cmpd_attr.val_paths, path);
}
compound_graph_path *path;
ir_type *owner_tp = get_entity_owner(member);
assert(is_compound_entity(ent));
+ allocate_values(ent);
path = new_compound_graph_path(get_entity_type(ent), 1);
path->list[0].node = member;
if (is_Array_type(owner_tp)) {
int idx;
assert(size > 0);
- if(size % align > 0) {
+ if (size % align > 0) {
size += align - (size % align);
}
idx = get_compound_graph_path_array_index(path, i);
path_len = get_compound_graph_path_length(path);
last_node = get_compound_graph_path_node(path, path_len - 1);
- if(last_node == NULL)
+ if (last_node == NULL)
return 0;
return get_entity_offset_bits_remainder(last_node);
{
assert(ent->initializer == NULL);
assert(is_compound_entity(ent));
+ allocate_values((ir_entity*) ent);
return ARR_LEN(ent->attr.cmpd_attr.values);
}