From 13a5a6506d53e7d5ebcda6aabe82f930c81fa9b3 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 13 Apr 2016 13:16:09 -0400 Subject: [PATCH 82/91] FIXME: fix output from fatal_with_file_and_line --- gcc/read-md.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gcc/read-md.c b/gcc/read-md.c index c2548ca..56d1a62 100644 --- a/gcc/read-md.c +++ b/gcc/read-md.c @@ -277,6 +277,7 @@ fatal_at (file_location loc, const char *msg, ...) void fatal_with_file_and_line (const char *msg, ...) { +#ifdef GENERATOR_FILE char context[64]; size_t i; int c; @@ -289,10 +290,6 @@ fatal_with_file_and_line (const char *msg, ...) vfprintf (stderr, msg, ap); putc ('\n', stderr); -#ifndef GENERATOR_FILE - file_location loc = rtx_reader_ptr->get_current_location (); -#endif - /* Gather some following context. */ for (i = 0; i < sizeof (context)-1; ++i) { @@ -313,10 +310,16 @@ fatal_with_file_and_line (const char *msg, ...) context); va_end (ap); - -#ifndef GENERATOR_FILE - inform (loc, "here"); -#endif +#else /* #ifdef GENERATOR_FILE */ + diagnostic_info diagnostic; + va_list ap; + file_location loc = rtx_reader_ptr->get_current_location (); + rich_location richloc (line_table, loc); + va_start (ap, msg); + diagnostic_set_info (&diagnostic, msg, &ap, &richloc, DK_ERROR); + report_diagnostic (&diagnostic); + va_end (ap); +#endif /* #else of #ifdef GENERATOR_FILE */ exit (1); } -- 1.8.5.3