}
}
+/* Emit a fprintf to the debug file to the file F, with the INDENT from
+ either the RESULT location or the S's match location if RESULT is null. */
+static void
+emit_debug_printf (FILE *f, int indent, class simplify *s, operand *result)
+{
+ fprintf_indent (f, indent, "if (UNLIKELY (debug_dump)) "
+ "fprintf (dump_file, \"%s ",
+ s->kind == simplify::SIMPLIFY
+ ? "Applying pattern" : "Matching expression");
+ fprintf (f, "%%s:%%d, %%s:%%d\\n\", ");
+ output_line_directive (f,
+ result ? result->location : s->match->location, true,
+ true);
+ fprintf (f, ", __FILE__, __LINE__);\n");
+}
/* Generate code for the '(if ...)', '(with ..)' and actual transform
step of a '(simplify ...)' or '(match ...)'. This handles everything
needs_label = true;
}
- fprintf_indent (f, indent, "if (UNLIKELY (debug_dump)) "
- "fprintf (dump_file, \"%s ",
- s->kind == simplify::SIMPLIFY
- ? "Applying pattern" : "Matching expression");
- fprintf (f, "%%s:%%d, %%s:%%d\\n\", ");
- output_line_directive (f,
- result ? result->location : s->match->location, true,
- true);
- fprintf (f, ", __FILE__, __LINE__);\n");
-
fprintf_indent (f, indent, "{\n");
indent += 2;
if (!result)
{
/* If there is no result then this is a predicate implementation. */
+ emit_debug_printf (f, indent, s, result);
fprintf_indent (f, indent, "return true;\n");
}
else if (gimple)
}
else
gcc_unreachable ();
+ emit_debug_printf (f, indent, s, result);
fprintf_indent (f, indent, "return true;\n");
}
else /* GENERIC */
&cinfo, indexes);
}
if (is_predicate)
- fprintf_indent (f, indent, "return true;\n");
+ {
+ emit_debug_printf (f, indent, s, result);
+ fprintf_indent (f, indent, "return true;\n");
+ }
else
{
fprintf_indent (f, indent, "tree _r;\n");
i);
}
}
+ emit_debug_printf (f, indent, s, result);
fprintf_indent (f, indent, "return _r;\n");
}
}