removed C99 features
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 10 Mar 2005 10:51:22 +0000 (10:51 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 10 Mar 2005 10:51:22 +0000 (10:51 +0000)
[r5343]

ir/ana/field_temperature.c
ir/opt/opt_polymorphy.c
ir/tr/entity.c

index 4747231..feca84a 100644 (file)
@@ -171,6 +171,7 @@ double get_type_estimated_n_instances(type *tp) {
 
 double get_type_estimated_mem_consumption_bytes(type *tp) {
   assert(0);
+  return 0.0;
 }
 
 int get_type_estimated_n_fields(type *tp) {
@@ -397,11 +398,13 @@ double get_entity_estimated_n_dyncalls(entity *ent) {
 /* ------------------------------------------------------------------------- */
 
 static void acc_temp (type *tp) {
-  assert(is_Class_type(tp));
+  int i, n_subtypes, n_members;
+  double inst;
 
-  int i, n_subtypes = get_class_n_subtypes(tp);
+  assert(is_Class_type(tp));
 
   /* Recursive descend. */
+  n_subtypes = get_class_n_subtypes(tp);
   for (i = 0; i < n_subtypes; ++i) {
     type *stp = get_class_subtype(tp, i);
     if (type_not_visited(stp)) {
@@ -410,7 +413,7 @@ static void acc_temp (type *tp) {
   }
 
   /* Deal with entity numbers. */
-  int n_members = get_class_n_members(tp);
+  n_members = get_class_n_members(tp);
   for (i = 0; i < n_members; ++i) {
     entity *mem = get_class_member(tp, i);
     double acc_loads  = get_entity_estimated_n_loads (mem);
@@ -426,7 +429,7 @@ static void acc_temp (type *tp) {
   }
 
   /* Deal with type numbers. */
-  double inst = get_type_estimated_n_instances(tp);
+  inst = get_type_estimated_n_instances(tp);
   for (i = 0; i < n_subtypes; ++i) {
     type *stp = get_class_subtype(tp, i);
     inst += get_type_acc_estimated_n_instances(stp);
@@ -447,12 +450,12 @@ void accumulate_temperatures(void) {
       int j, n_subtypes = get_class_n_subtypes(tp);
       int has_unmarked_subtype = false;
       for (j = 0; j < n_subtypes && !has_unmarked_subtype; ++j) {
-       type *stp = get_class_subtype(tp, j);
-       if (type_not_visited(stp)) has_unmarked_subtype = true;
+             type *stp = get_class_subtype(tp, j);
+             if (type_not_visited(stp)) has_unmarked_subtype = true;
       }
 
       if (!has_unmarked_subtype)
-       acc_temp(tp);
+             acc_temp(tp);
     }
   }
 
index 3e3ada3..67ca5a9 100644 (file)
@@ -41,8 +41,9 @@ static type *get_dynamic_type(ir_node *ptr) {
  */
 ir_node *transform_node_Sel(ir_node *node)
 {
-  entity *ent = get_Sel_entity(node);
-  ir_node *new_node;
+  ir_node *new_node, *ptr;
+  type    *dyn_tp;
+  entity  *ent = get_Sel_entity(node);
 
   if (get_irp_phase_state() == phase_building) return node;
 
@@ -72,18 +73,19 @@ ir_node *transform_node_Sel(ir_node *node)
   }
 
   /* If we know the dynamic type, we can replace the Sel by a constant. */
-  ir_node *ptr = get_Sel_ptr(node);      /* The address we select from. */
-  type *dyn_tp = get_dynamic_type(ptr);  /* The runtime type of ptr. */
+  ptr = get_Sel_ptr(node);      /* The address we select from. */
+  dyn_tp = get_dynamic_type(ptr);  /* The runtime type of ptr. */
 
   if (dyn_tp != firm_unknown_type) {
     entity *called_ent;
+    ir_node *rem_block;
 
     /* We know which method will be called, no dispatch necessary. */
     called_ent = resolve_ent_polymorphy(dyn_tp, ent);
     /* called_ent may not be description: has no Address/Const to Call! */
     assert(get_entity_peculiarity(called_ent) != peculiarity_description);
 
-    ir_node *rem_block = get_cur_block();
+    rem_block = get_cur_block();
     set_cur_block(get_nodes_block(node));
     new_node = copy_const_value(get_atomic_ent_value(called_ent));
     set_cur_block(rem_block);
@@ -105,16 +107,18 @@ ir_node *transform_node_Sel(ir_node *node)
  */
 ir_node *transform_node_Load(ir_node *n)
 {
+  ir_node *field_ptr, *new_node, *ptr;
+  entity  *ent;
+  type    *dyn_tp;
+
   if (!(get_opt_optimize() && get_opt_dyn_meth_dispatch()))
     return n;
 
-  ir_node *field_ptr = get_Load_ptr(n);
+  field_ptr = get_Load_ptr(n);
 
   if (get_irn_op(field_ptr) != op_Sel) return n;
 
-  entity *ent  = get_Sel_entity(field_ptr);
-  ir_node *new_node;
-
+  ent = get_Sel_entity(field_ptr);
   if ((get_entity_allocation(ent) != allocation_static)    ||
       (get_entity_variability(ent) != variability_constant)  )
     return n;
@@ -129,8 +133,8 @@ ir_node *transform_node_Load(ir_node *n)
   }
 
   /* If we know the dynamic type, we can replace the Sel by a constant. */
-  ir_node *ptr = get_Sel_ptr(field_ptr);      /* The address we select from. */
-  type *dyn_tp = get_dynamic_type(ptr);  /* The runtime type of ptr. */
+  ptr = get_Sel_ptr(field_ptr);    /* The address we select from. */
+  dyn_tp = get_dynamic_type(ptr);  /* The runtime type of ptr. */
 
   if (dyn_tp != firm_unknown_type) {
     entity *loaded_ent;
index 9a11278..c6b1b6d 100644 (file)
@@ -696,6 +696,9 @@ get_compound_ent_value_path(entity *ent, int pos) {
   return ent->val_paths[pos];
 }
 
+/**
+ * Returns non-zero, if two compound_graph_pathes are equal
+ */
 static int equal_paths(compound_graph_path *path1, int *visited_indicees, compound_graph_path *path2) {
   int i;
   int len1 = get_compound_graph_path_length(path1);
@@ -704,19 +707,25 @@ static int equal_paths(compound_graph_path *path1, int *visited_indicees, compou
   if (len2 > len1) return false;
 
   for (i = 0; i < len1; i++) {
+    type   *tp;
     entity *node1 = get_compound_graph_path_node(path1, i);
     entity *node2 = get_compound_graph_path_node(path2, i);
+
     if (node1 != node2) return false;
-    type *tp = get_entity_owner(node1);
+
+    tp = get_entity_owner(node1);
     if (is_Array_type(tp)) {
+      long low;
+
       /* Compute the index of this node. */
       assert(get_array_n_dimensions(tp) == 1 && "multidim not implemented");
-      long low = get_array_lower_bound_int(tp, 0);
-      if (low+visited_indicees[i] < get_compound_graph_path_array_index(path2, i)) {
-       visited_indicees[i]++;
-       return false;
+
+      low = get_array_lower_bound_int(tp, 0);
+      if (low + visited_indicees[i] < get_compound_graph_path_array_index(path2, i)) {
+             visited_indicees[i]++;
+             return false;
       } else {
-       assert(low+visited_indicees[i] == get_compound_graph_path_array_index(path2, i));
+             assert(low + visited_indicees[i] == get_compound_graph_path_array_index(path2, i));
       }
     }
   }