BugFix: turn_into_tuple() now works if edges are activated
[libfirm] / ir / tr / trvrfy.c
index f3ec6b4..4235929 100644 (file)
@@ -276,8 +276,11 @@ static int constant_on_wrong_irg(ir_node *n) {
   return ! env.res;
 }
 
-/*
+/**
  * Check if constants node are NOT on the constant IR graph.
+ *
+ * @return NON-zero if an entity initializer constant is NOT on
+ * the current_ir_graph's obstack.
  */
 static int constants_on_wrong_irg(entity *ent) {
   if (get_entity_variability(ent) == variability_uninitialized) return 0;
@@ -305,6 +308,16 @@ static int constants_on_wrong_irg(entity *ent) {
   return 0;
 }
 
+/**
+ * Shows a wrong entity allocation
+ */
+static void show_ent_alloc_error(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.
@@ -319,7 +332,11 @@ int check_entity(entity *ent) {
   ir_type *owner = get_entity_owner(ent);
 
   current_ir_graph =  get_const_code_irg();
-  ASSERT_AND_RET(constants_on_wrong_irg(ent) == 0, "Contants placed on wrong IRG", error_const_on_wrong_irg);
+  ASSERT_AND_RET_DBG(
+    constants_on_wrong_irg(ent) == 0,
+    "Contants placed on wrong IRG",
+    error_const_on_wrong_irg,
+    ir_fprintf(stderr, "%+e not on %+F\n", ent, current_ir_graph));
 
   rem_vpi = get_visit_pseudo_irgs();
   set_visit_pseudo_irgs(1);
@@ -358,7 +375,7 @@ int check_entity(entity *ent) {
            get_entity_allocation(ent) != allocation_automatic,
       "Entities in global type are not allowed to by dynamic or automatic allocated",
       error_glob_ent_allocation,
-      ir_fprintf(stderr, "%+e\n", ent)
+      show_ent_alloc_error(ent)
     );
   }