added doxygen comments
[libfirm] / ir / ir / irvrfy.c
index b1fd421..d973700 100644 (file)
@@ -133,6 +133,24 @@ static void show_unop_failure(ir_node *n, const char *text)
       text);
 }
 
+/**
+ * Prints a failure message for an op with 3 operands
+ */
+static void show_triop_failure(ir_node *n, const char *text)
+{
+  ir_node *op0  = get_irn_n(n, 0);
+  ir_node *op1  = get_irn_n(n, 1);
+  ir_node *op2  = get_irn_n(n, 2);
+
+  fprintf(stderr, "\nFIRM: irn_vrfy_irg() of node %ld %s%s(%s%s, %s%s, %s%s) did not match (%s)\n",
+      get_irn_node_nr(n),
+      get_irn_opname(n), get_irn_modename(n),
+      get_irn_opname(op0), get_irn_modename(op0),
+      get_irn_opname(op1), get_irn_modename(op1),
+      get_irn_opname(op2), get_irn_modename(op2),
+      text);
+}
+
 /**
  * Prints a failure message for a proj
  */
@@ -640,7 +658,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       for (i = 0; i < get_Return_n_ress(n); i++) {
         type *res_type = get_method_res_type(mt, i);
 
-        if (is_Atomic_type(res_type)) {
+        if (is_atomic_type(res_type)) {
           ASSERT_AND_RET_DBG(
             get_irn_mode(get_Return_res(n, i)) == get_type_mode(res_type),
             "Mode of result for Return doesn't match mode of result type.", 0,
@@ -752,7 +770,7 @@ 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);
 
-        if (is_Atomic_type(t)) {
+        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,
@@ -832,9 +850,9 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
     case iro_Minus:
       op1mode = get_irn_mode(in[1]);
       ASSERT_AND_RET_DBG(
-                         /* Minus: BB x float --> float */
-                         op1mode == mymode && mode_is_float(op1mode), "Minus node", 0,
-                         show_unop_failure(n , "/* Minus: BB x float --> float */");
+                         /* Minus: BB x num --> num */
+                         op1mode == mymode && mode_is_num(op1mode), "Minus node", 0,
+                         show_unop_failure(n , "/* Minus: BB x num --> num */");
                          );
       op_is_symmetric = 2;
       break;
@@ -1099,12 +1117,15 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
     case iro_Free:
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
+      op3mode = get_irn_mode(in[3]);
       ASSERT_AND_RET_DBG(
-                         /* Free: BB x M x ref --> M */
+                         /* Free: BB x M x ref x int_u --> M */
                          op1mode == mode_M && mode_is_reference(op2mode) &&
+                         mode_is_int(op3mode) &&
+                         !mode_is_signed(op3mode) &&
                          mymode == mode_M,
                          "Free node", 0,
-                         show_binop_failure(n, "/* Free: BB x M x ref --> M */");
+                         show_triop_failure(n, "/* Free: BB x M x ref x int_u --> M */");
                          );
       break;