/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
#include "irprintf.h"
#include "irgwalk.h"
-static const char *firm_vrfy_failure_msg;
#ifdef NDEBUG
/*
#endif /* NDEBUG */
+#ifndef NDEBUG
+
+static const char *firm_vrfy_failure_msg;
+
/**
* Show diagnostic if an entity overwrites another one not
* in direct superclasses.
}
}
+/**
+ * Shows a wrong entity allocation
+ */
+static void show_ent_alloc_error(ir_entity *ent) {
+ ir_fprintf(stderr, "%+e owner %t has allocation %s\n",
+ ent, get_entity_type(ent),
+ get_allocation_name(get_entity_allocation(ent)));
+}
+
+#endif /* #ifndef NDEBUG */
+
/**
* Check a class
*/
if (get_entity_variability(ent) == variability_uninitialized) return 0;
if (is_compound_entity(ent)) {
- int i;
- for (i = 0; i < get_compound_ent_n_values(ent); i++) {
- if (constant_on_wrong_irg(get_compound_ent_value(ent, i)))
- return 1;
+ if(!ent->has_initializer) {
+ int i;
+ for (i = get_compound_ent_n_values(ent) - 1; i >= 0; --i) {
+ if (constant_on_wrong_irg(get_compound_ent_value(ent, i)))
+ return 1;
+ }
}
} else {
/* Might not be set if entity belongs to a description or is external allocated. */
return 0;
}
-/**
- * Shows a wrong entity allocation
- */
-static void show_ent_alloc_error(ir_entity *ent) {
- ir_fprintf(stderr, "%+e owner %t has allocation %s\n",
- ent, get_entity_type(ent),
- get_allocation_name(get_entity_allocation(ent)));
-}
-
/*
* Check an entity. Currently, we check only if initialized constants
* are build on the const irg graph.