Commit 9e525f08 by Nathan Sidwell Committed by Nathan Sidwell

[PATCH] Diagnostic included-from loop

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00416.html
	* diagnostic.c (diagnostic_report_current_module): Reroll
	included-at loop.  Translate text.

From-SVN: r263341
parent 0250ba58
2018-08-06 Nathan Sidwell <nathan@acm.org>
* diagnostic.c (diagnostic_report_current_module): Reroll
included-at loop. Translate text.
2018-08-06 David Malcolm <dmalcolm@redhat.com> 2018-08-06 David Malcolm <dmalcolm@redhat.com>
* function-tests.c (selftest::test_expansion_to_rtl): Call * function-tests.c (selftest::test_expansion_to_rtl): Call
......
...@@ -587,22 +587,26 @@ diagnostic_report_current_module (diagnostic_context *context, location_t where) ...@@ -587,22 +587,26 @@ diagnostic_report_current_module (diagnostic_context *context, location_t where)
set_last_module (context, map); set_last_module (context, map);
if (! MAIN_FILE_P (map)) if (! MAIN_FILE_P (map))
{ {
map = INCLUDED_FROM (line_table, map); bool first = true;
const char *line_col do
= maybe_line_and_column (LAST_SOURCE_LINE (map),
context->show_column
? LAST_SOURCE_COLUMN (map) : 0);
pp_verbatim (context->printer,
"In file included from %r%s%s%R", "locus",
LINEMAP_FILE (map), line_col);
while (! MAIN_FILE_P (map))
{ {
map = INCLUDED_FROM (line_table, map); map = INCLUDED_FROM (line_table, map);
line_col = maybe_line_and_column (LAST_SOURCE_LINE (map), 0); const char *line_col
pp_verbatim (context->printer, = maybe_line_and_column (LAST_SOURCE_LINE (map),
",\n from %r%s%s%R", "locus", first && context->show_column
LINEMAP_FILE (map), line_col); ? SOURCE_COLUMN (map, where) : 0);
static const char *const msgs[] =
{
N_("In file included from"),
N_(" from"),
};
unsigned index = !first;
pp_verbatim (context->printer, "%s%s %r%s%s%R",
first ? "" : ",\n", _(msgs[index]),
"locus", LINEMAP_FILE (map), line_col);
first = false;
} }
while (! MAIN_FILE_P (map));
pp_verbatim (context->printer, ":"); pp_verbatim (context->printer, ":");
pp_newline (context->printer); pp_newline (context->printer);
} }
......
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