renamed where_alloc to ir_where_alloc
[libfirm] / ir / ana / cgana.c
index c43ed4a..35cca90 100644 (file)
@@ -228,7 +228,7 @@ static void sel_methods_walker(ir_node * node, void *env) {
                                 */
                                assert (get_entity_peculiarity(ent) == peculiarity_description);
                        }
-                       else if (get_opt_optimize() && get_opt_closed_world() && get_opt_dyn_meth_dispatch() &&
+                       else if (get_opt_closed_world() && get_opt_dyn_meth_dispatch() &&
                                (ARR_LEN(arr) == 1 && arr[0] != NULL)) {
                                        ir_node *new_node;
 
@@ -510,26 +510,22 @@ static void add_method_address(ir_entity *ent, eset *set)
 
                /* let's check if it's the address of a function */
                n = get_atomic_ent_value(ent);
-               if (get_irn_op(n) == op_SymConst) {
-                       if (get_SymConst_kind(n) == symconst_addr_ent) {
-                               ent = get_SymConst_entity(n);
+               if (is_SymConst(n) && get_SymConst_kind(n) == symconst_addr_ent) {
+                       ent = get_SymConst_entity(n);
 
-                               if (is_Method_type(get_entity_type(ent)))
-                                       eset_insert(set, ent);
-                       }
+                       if (is_Method_type(get_entity_type(ent)))
+                               eset_insert(set, ent);
                }
        } else {
                for (i = get_compound_ent_n_values(ent) - 1; i >= 0; --i) {
                        n = get_compound_ent_value(ent, i);
 
                        /* let's check if it's the address of a function */
-                       if (get_irn_op(n) == op_SymConst) {
-                               if (get_SymConst_kind(n) == symconst_addr_ent) {
-                                       ir_entity *ent = get_SymConst_entity(n);
+                       if (is_SymConst(n) && get_SymConst_kind(n) == symconst_addr_ent) {
+                               ir_entity *ent = get_SymConst_entity(n);
 
-                                       if (is_Method_type(get_entity_type(ent)))
-                                               eset_insert(set, ent);
-                               }
+                               if (is_Method_type(get_entity_type(ent)))
+                                       eset_insert(set, ent);
                        }
                }
        }
@@ -575,7 +571,7 @@ static ir_entity ** get_free_methods(void)
                }
        }
 
-       /* insert all methods the initializes global variables */
+       /* insert all methods that are used in global variables initializers */
        glob = get_glob_type();
        for (i = get_class_n_members(glob) - 1; i >= 0; --i) {
                ent = get_class_member(glob, i);