Commit 1e1e5373 authored by Michael Beck's avatar Michael Beck
Browse files

find_array_dimension() added

some doxygen docu added

[r5379]
parent a10a3034
......@@ -1338,8 +1338,7 @@ int (is_Union_type)(const type *uni) {
/* create a new type array -- set dimension sizes independently */
type *new_type_array (ident *name, int n_dimensions,
type *element_type) {
type *new_type_array(ident *name, int n_dimensions, type *element_type) {
type *res;
int i;
ir_graph *rem = current_ir_graph;
......@@ -1353,9 +1352,9 @@ type *new_type_array (ident *name, int n_dimensions,
current_ir_graph = get_const_code_irg();
for (i = 0; i < n_dimensions; i++) {
res->attr.aa.lower_bound[i] = new_Unknown(mode_Iu);
res->attr.aa.upper_bound[i] = new_Unknown(mode_Iu);
res->attr.aa.order[i] = i;
res->attr.aa.lower_bound[i] = new_Unknown(mode_Iu);
res->attr.aa.upper_bound[i] = new_Unknown(mode_Iu);
res->attr.aa.order[i] = i;
}
current_ir_graph = rem;
......@@ -1469,11 +1468,24 @@ void set_array_order (type *array, int dimension, int order) {
assert(array && (array->type_op == type_array));
array->attr.aa.order[dimension] = order;
}
int get_array_order (const type *array, int dimension) {
assert(array && (array->type_op == type_array));
return array->attr.aa.order[dimension];
}
int find_array_dimension(const type *array, int order) {
int dim;
assert(array && (array->type_op == type_array));
for (dim = 0; dim < array->attr.aa.n_dimensions; ++dim) {
if (array->attr.aa.order[dim] == order)
return dim;
}
return -1;
}
void set_array_element_type (type *array, type *tp) {
assert(array && (array->type_op == type_array));
assert(!is_Method_type(tp));
......
......@@ -792,13 +792,25 @@ ir_node * get_array_upper_bound (const type *array, int dimension);
/** Works only if bound is Const node with tarval that can be converted to long. */
long get_array_upper_bound_int (const type *array, int dimension);
/** Sets an array dimension to a specific order. */
void set_array_order (type *array, int dimension, int order);
/** Returns the order of an array dimension. */
int get_array_order (const type *array, int dimension);
/** Find the array dimension that is placed at order ord. */
int find_array_dimension(const type *array, int order);
/** Sets the array element type. */
void set_array_element_type (type *array, type *tp);
/** Gets the array element type. */
type *get_array_element_type (type *array);
/** Sets the array element entity. */
void set_array_element_entity (type *array, entity *ent);
/** Get the array element entity. */
entity *get_array_element_entity (const type *array);
/** Returns true if a type is an array type. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment