Commit 8fcfe047 by Martin Liska Committed by Martin Liska

genmatch: put reporting on a cold path

2018-09-04  Martin Liska  <mliska@suse.cz>

	* genmatch.c (output_line_directive): Add new argument
	fnargs.
	(dt_simplify::gen_1): Encapsulate dump within __builtin_expect.

From-SVN: r264084
parent b88ad32d
2018-09-04 Martin Liska <mliska@suse.cz>
* genmatch.c (output_line_directive): Add new argument
fnargs.
(dt_simplify::gen_1): Encapsulate dump within __builtin_expect.
2018-09-04 Jonathan Wakely <jwakely@redhat.com> 2018-09-04 Jonathan Wakely <jwakely@redhat.com>
* doc/invoke.texi (Option Summary): Add whitespace. * doc/invoke.texi (Option Summary): Add whitespace.
......
...@@ -184,7 +184,7 @@ fprintf_indent (FILE *f, unsigned int indent, const char *format, ...) ...@@ -184,7 +184,7 @@ fprintf_indent (FILE *f, unsigned int indent, const char *format, ...)
static void static void
output_line_directive (FILE *f, source_location location, output_line_directive (FILE *f, source_location location,
bool dumpfile = false) bool dumpfile = false, bool fnargs = false)
{ {
const line_map_ordinary *map; const line_map_ordinary *map;
linemap_resolve_location (line_table, location, LRK_SPELLING_LOCATION, &map); linemap_resolve_location (line_table, location, LRK_SPELLING_LOCATION, &map);
...@@ -202,6 +202,10 @@ output_line_directive (FILE *f, source_location location, ...@@ -202,6 +202,10 @@ output_line_directive (FILE *f, source_location location,
file = loc.file; file = loc.file;
else else
++file; ++file;
if (fnargs)
fprintf (f, "\"%s\", %d", file, loc.line);
else
fprintf (f, "%s:%d", file, loc.line); fprintf (f, "%s:%d", file, loc.line);
} }
else else
...@@ -3305,11 +3309,13 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) ...@@ -3305,11 +3309,13 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result)
} }
} }
fprintf_indent (f, indent, "if (dump_file && (dump_flags & TDF_FOLDING)) " fprintf_indent (f, indent, "if (__builtin_expect (dump_file && (dump_flags & TDF_FOLDING), 0)) "
"fprintf (dump_file, \"Applying pattern "); "fprintf (dump_file, \"Applying pattern ");
fprintf (f, "%%s:%%d, %%s:%%d\\n\", ");
output_line_directive (f, output_line_directive (f,
result ? result->location : s->match->location, true); result ? result->location : s->match->location, true,
fprintf (f, ", %%s:%%d\\n\", __FILE__, __LINE__);\n"); true);
fprintf (f, ", __FILE__, __LINE__);\n");
if (!result) if (!result)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment