BugFix: fixed list_for_each_safe() instance.
[libfirm] / ir / tr / tr_inheritance.c
index 009d48f..33d77a2 100644 (file)
@@ -80,10 +80,10 @@ static void copy_entities_from_superclass(ir_type *clss, void *env)
                                if (get_entity_peculiarity(inhent) == peculiarity_existent)
                                        set_entity_peculiarity(thisent, peculiarity_inherited);
                                set_entity_ld_ident(thisent, mfunc(inhent, clss));
-                               if (get_entity_variability(inhent) == variability_constant) {
+                               if (get_entity_linkage(inhent) & IR_LINKAGE_CONSTANT) {
                                        assert(is_atomic_entity(inhent) &&  /* @@@ */
                                                "Inheritance of constant, compound entities not implemented");
-                                       set_entity_variability(thisent, variability_constant);
+                                       add_entity_linkage(thisent, IR_LINKAGE_CONSTANT);
                                        set_atomic_ent_value(thisent, get_atomic_ent_value(inhent));
                                }
                        }
@@ -337,6 +337,7 @@ void compute_inh_transitive_closure(void) {
        free_inh_transitive_closure();
 
        /* The 'down' relation */
+       irp_reserve_resources(irp, IR_RESOURCE_TYPE_VISITED);
        inc_master_type_visited();  /* Inc twice: one if on stack, second if values computed. */
        inc_master_type_visited();
        for (i = 0; i < n_types; ++i) {
@@ -385,6 +386,7 @@ void compute_inh_transitive_closure(void) {
        }
 
        irp->inh_trans_closure_state = inh_transitive_closure_valid;
+       irp_free_resources(irp, IR_RESOURCE_TYPE_VISITED);
 }
 
 /** Free memory occupied by the transitive closure information. */