formatted, more verbose debug output,
[libfirm] / ir / tr / type.c
index b937420..04ce12f 100644 (file)
@@ -1287,7 +1287,7 @@ type *new_type_array         (ident *name, int n_dimensions,
   current_ir_graph = rem;
 
   res->attr.aa.element_type = element_type;
-  new_entity(res, mangle_u(name, id_from_str("elem_ent", 8)), element_type);
+  new_entity(res, mangle_u(name, new_id_from_chars("elem_ent", 8)), element_type);
 
   return res;
 }
@@ -1361,14 +1361,21 @@ void  set_array_upper_bound_int (type *array, int dimension, int upper_bound) {
                          new_Const(mode_Iu, new_tarval_from_long (upper_bound, mode_Iu)));
   current_ir_graph = rem;
 }
-int       has_array_lower_bound  (type *array, int dimension) {
+int      has_array_lower_bound  (type *array, int dimension) {
   assert(array && (array->type_op == type_array));
   return (get_irn_op(array->attr.aa.lower_bound[dimension]) != op_Unknown);
 }
-ir_node * get_array_lower_bound  (type *array, int dimension) {
+ir_node *get_array_lower_bound  (type *array, int dimension) {
   assert(array && (array->type_op == type_array));
   return array->attr.aa.lower_bound[dimension];
 }
+long     get_array_lower_bound_int  (type *array, int dimension) {
+  ir_node *node;
+  assert(array && (array->type_op == type_array));
+  node = array->attr.aa.lower_bound[dimension];
+  assert(get_irn_op(node) == op_Const);
+  return get_tarval_long(get_Const_tarval(node));
+}
 int       has_array_upper_bound  (type *array, int dimension) {
   assert(array && (array->type_op == type_array));
   return (get_irn_op(array->attr.aa.upper_bound[dimension]) != op_Unknown);
@@ -1377,6 +1384,13 @@ ir_node * get_array_upper_bound  (type *array, int dimension) {
   assert(array && (array->type_op == type_array));
   return array->attr.aa.upper_bound[dimension];
 }
+long     get_array_upper_bound_int  (type *array, int dimension) {
+  ir_node *node;
+  assert(array && (array->type_op == type_array));
+  node = array->attr.aa.upper_bound[dimension];
+  assert(get_irn_op(node) == op_Const);
+  return get_tarval_long(get_Const_tarval(node));
+}
 
 void set_array_order (type *array, int dimension, int order) {
   assert(array && (array->type_op == type_array));