- if (pos == get_compound_graph_path_length(gr))
- if (!is_atomic_type(owner))
- return 0;
- return 1;
-} /* is_proper_compound_graph_path */
-
-/* Returns the length of a graph path */
-int get_compound_graph_path_length(const compound_graph_path *gr) {
- assert(gr && is_compound_graph_path(gr));
- return gr->len;
-} /* get_compound_graph_path_length */
-
-ir_entity *
-get_compound_graph_path_node(const compound_graph_path *gr, int pos) {
- assert(gr && is_compound_graph_path(gr));
- assert(pos >= 0 && pos < gr->len);
- return gr->list[pos].node;
-} /* get_compound_graph_path_node */
-
-void
-set_compound_graph_path_node(compound_graph_path *gr, int pos, ir_entity *node) {
- assert(gr && is_compound_graph_path(gr));
- assert(pos >= 0 && pos < gr->len);
- assert(is_entity(node));
- gr->list[pos].node = node;
- assert(is_proper_compound_graph_path(gr, pos));
-} /* set_compound_graph_path_node */
-
-int
-get_compound_graph_path_array_index(const compound_graph_path *gr, int pos) {
- assert(gr && is_compound_graph_path(gr));
- assert(pos >= 0 && pos < gr->len);
- return gr->list[pos].index;
-} /* get_compound_graph_path_array_index */
-
-void
-set_compound_graph_path_array_index(compound_graph_path *gr, int pos, int index) {
- assert(gr && is_compound_graph_path(gr));
- assert(pos >= 0 && pos < gr->len);
- gr->list[pos].index = index;
-} /* set_compound_graph_path_array_index */
-
-/* A value of a compound entity is a pair of value and the corresponding path to a member of
- the compound. */
-void
-add_compound_ent_value_w_path(ir_entity *ent, ir_node *val, compound_graph_path *path) {
- assert(is_compound_entity(ent) && (ent->variability != variability_uninitialized));
- assert(is_compound_graph_path(path));
- ARR_APP1(ir_node *, ent->attr.cmpd_attr.values, val);
- ARR_APP1(compound_graph_path *, ent->attr.cmpd_attr.val_paths, path);
-} /* add_compound_ent_value_w_path */
-
-void
-set_compound_ent_value_w_path(ir_entity *ent, ir_node *val, compound_graph_path *path, int pos) {
- assert(is_compound_entity(ent) && (ent->variability != variability_uninitialized));
- assert(is_compound_graph_path(path));
- assert(0 <= pos && pos < ARR_LEN(ent->attr.cmpd_attr.values));
- ent->attr.cmpd_attr.values[pos] = val;
- ent->attr.cmpd_attr.val_paths[pos] = path;
-} /* set_compound_ent_value_w_path */
-
-int
-get_compound_ent_n_values(ir_entity *ent) {
- assert(is_compound_entity(ent) && (ent->variability != variability_uninitialized));
- return ARR_LEN(ent->attr.cmpd_attr.values);
-} /* get_compound_ent_n_values */
-
-ir_node *
-get_compound_ent_value(ir_entity *ent, int pos) {
- assert(is_compound_entity(ent) && (ent->variability != variability_uninitialized));
- assert(0 <= pos && pos < ARR_LEN(ent->attr.cmpd_attr.values));
- return ent->attr.cmpd_attr.values[pos];
-} /* get_compound_ent_value */
-
-compound_graph_path *
-get_compound_ent_value_path(ir_entity *ent, int pos) {
- assert(is_compound_entity(ent) && (ent->variability != variability_uninitialized));
- assert(0 <= pos && pos < ARR_LEN(ent->attr.cmpd_attr.val_paths));
- return ent->attr.cmpd_attr.val_paths[pos];
-} /* get_compound_ent_value_path */
-
-/**
- * Returns non-zero, if two compound_graph_pathes are equal
- *
- * @param path1 the first path
- * @param visited_indices
- * @param path2 the second path
- */
-static int equal_paths(compound_graph_path *path1, int *visited_indices, compound_graph_path *path2) {
- int i;
- int len1 = get_compound_graph_path_length(path1);
- int len2 = get_compound_graph_path_length(path2);
-
- if (len2 != len1) return 0;