+2019-12-06 Richard Biener <rguenther@suse.de>
+
+ * genmatch.c (c_expr::gen_transform): Emit newlines from line
+ number changes rather than after every semicolon.
+
2019-12-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/92819
fprintf_indent (f, indent, "%s = ", dest);
unsigned stmt_nr = 1;
+ int prev_line = -1;
for (unsigned i = 0; i < code.length (); ++i)
{
const cpp_token *token = &code[i];
+ /* We can't recover from all lexing losses but we can roughly restore line
+ breaks from location info. */
+ const line_map_ordinary *map;
+ linemap_resolve_location (line_table, token->src_loc,
+ LRK_SPELLING_LOCATION, &map);
+ expanded_location loc = linemap_expand_location (line_table, map,
+ token->src_loc);
+ if (prev_line != -1 && loc.line != prev_line)
+ fputc ('\n', f);
+ prev_line = loc.line;
+
/* Replace captures for code-gen. */
if (token->type == CPP_ATSIGN)
{
if (token->type == CPP_SEMICOLON)
{
stmt_nr++;
- fputc ('\n', f);
if (dest && stmt_nr == nr_stmts)
fprintf_indent (f, indent, "%s = ", dest);
}
}
+ fputc ('\n', f);
}
/* Generate transform code for a capture. */