fixed some depencies between irdump.c and irdumptxt.c
[libfirm] / ir / ir / irvrfy.c
index 4b1e4de..9006b8f 100644 (file)
@@ -36,7 +36,8 @@
 #define ASSERT_AND_RET(expr, string, ret) \
 do { \
   if (opt_do_node_verification == NODE_VERIFICATION_ON) {\
-    if (!(expr)) dump_ir_block_graph(current_ir_graph, "-assert"); \
+    if (!(expr) && current_ir_graph != get_const_code_irg()) \
+    dump_ir_block_graph(current_ir_graph, "-assert"); \
     assert((expr) && string); } \
   if (!(expr)) { \
     if (opt_do_node_verification == NODE_VERIFICATION_REPORT) \
@@ -324,18 +325,7 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
         "wrong Proj from Call", 0,
         show_proj_failure(p);
       );
-      break;
 
-    case iro_FuncCall:
-      ASSERT_AND_RET_DBG(
-        ((proj == pn_Call_M_regular        && mode == mode_M) ||
-         (proj == pn_Call_X_except         && mode == mode_X) ||
-         (proj == pn_Call_T_result         && mode == mode_T) ||
-         (proj == pn_Call_M_except         && mode == mode_M) ||
-     (proj == pn_Call_P_value_res_base && mode == mode_P)),
-        "wrong Proj from FuncCall", 0,
-        show_proj_failure(p);
-      );
       break;
 
     case iro_Quot:
@@ -365,7 +355,7 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
          (proj == pn_Div_X_except && mode == mode_X) ||
          (proj == pn_Div_res      && mode_is_int(mode))),
         "wrong Proj from Div or Mod", 0,
-    show_proj_failure(p);
+       show_proj_failure(p);
       );
       break;
 
@@ -492,24 +482,7 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
               ASSERT_AND_RET(
                   (mode == get_type_mode(get_method_res_type(mt, proj))),
                   "Mode of Proj from Call doesn't match mode of result type.", 0);
-            }
-            break;
-
-          case iro_FuncCall:
-            {
-              ASSERT_AND_RET(
-                  (proj >= 0 && mode_is_data(mode)),
-                  "wrong Proj from Proj from FuncCall", 0);
-              mt = get_FuncCall_type(pred);
-              ASSERT_AND_RET(
-                  (proj < get_method_n_ress(mt)),
-                  "More Projs for results than results in type.", 0);
-              if ((mode_is_reference(mode)) && is_compound_type(get_method_res_type(mt, proj)))
-                /* value result */ break;
 
-              ASSERT_AND_RET(
-                  (mode == get_type_mode(get_method_res_type(mt, proj))),
-                  "Mode of Proj from FuncCall doesn't match mode of result type.", 0);
             }
             break;
 
@@ -774,24 +747,32 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       }
 
       for (i = 0; i < get_method_n_params(mt); i++) {
-    type *t = get_method_param_type(mt, i);
+       type *t = get_method_param_type(mt, i);
 
-    if (is_atomic_type(t)) {
-      ASSERT_AND_RET_DBG(
-          get_irn_mode(get_Call_param(n, i)) == get_type_mode(t),
-          "Mode of arg for Call doesn't match mode of arg type.", 0,
-      show_call_param(n, mt);
-      );
-    }
-    else {
-      /* call with a compound type, mode must be reference */
-      ASSERT_AND_RET_DBG(
-          mode_is_reference(get_irn_mode(get_Call_param(n, i))),
-          "Mode of arg for Call doesn't match mode of arg type.", 0,
-      show_call_param(n, mt);
-      );
-    }
+       if (is_atomic_type(t)) {
+         ASSERT_AND_RET_DBG(
+                            get_irn_mode(get_Call_param(n, i)) == get_type_mode(t),
+                            "Mode of arg for Call doesn't match mode of arg type.", 0,
+                            show_call_param(n, mt);
+                            );
+       }
+       else {
+         /* call with a compound type, mode must be reference */
+         ASSERT_AND_RET_DBG(
+                            mode_is_reference(get_irn_mode(get_Call_param(n, i))),
+                            "Mode of arg for Call doesn't match mode of arg type.", 0,
+                            show_call_param(n, mt);
+                            );
+       }
       }
+
+#if 0
+      if (Call_has_callees(n)) {
+       for (i = 0; i < get_Call_n_callees(n); i++) {
+         ASSERT_AND_RET(is_entity(get_Call_callee(n, i)), "callee array must contain entities.", 0);
+       }
+      }
+#endif
       break;
 
     case iro_Add: