combos constant dataflow analysis has to be consistent with the localopt; this should...
[libfirm] / ir / tr / entity.c
index 157b746..65af77b 100644 (file)
@@ -609,9 +609,7 @@ ir_node *copy_const_value(dbg_info *dbg, ir_node *n)
        case iro_Unknown:
                nn = new_Unknown(m); break;
        default:
-               assert(0 && "opcode invalid or not implemented");
-               nn = NULL;
-               break;
+               panic("opcode invalid or not implemented");
        }
        return nn;
 }  /* copy_const_value */
@@ -725,13 +723,17 @@ static void check_entity_initializer(ir_entity *entity)
 {
 #ifndef NDEBUG
        ir_initializer_t *initializer = entity->initializer;
+       ir_type          *entity_tp   = get_entity_type(entity);
        switch (initializer->kind) {
        case IR_INITIALIZER_COMPOUND:
-               assert(is_compound_entity(entity));
+               assert(is_compound_type(entity_tp));
                break;
        case IR_INITIALIZER_CONST:
+               /* methods are initialized by a SymConst */
+               assert(is_atomic_type(entity_tp) || is_Method_type(entity_tp));
+               break;
        case IR_INITIALIZER_TARVAL:
-               assert(is_atomic_entity(entity));
+               assert(is_atomic_type(entity_tp));
                break;
        case IR_INITIALIZER_NULL:
                break;