diff mbox

Always pass explicit location to fatal_error

Message ID CAKOQZ8y5p-vx5sVJeRKW1NE9X8KtwJ34zGn8ETQU-nyM9QRWxg@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Jan. 30, 2015, 4:07 p.m. UTC
On Fri, Jan 30, 2015 at 12:52 AM, Joseph Myers <joseph@codesourcery.com> wrote:
>
> Ian: this patch does *not* change go/gofrontend/go.cc; you'll need to
> update that (such an update is of course best done before this patch
> goes in; since the overload currently exists, updating it does not
> depend on this patch).  I thought the go/gofrontend/ code wasn't
> supposed to use GCC-specific interfaces like that directly any more?

I've committed this patch to fix the problem for the Go frontend.
You're right: the Go frontend is not supposed to depend on GCC code in
this way.  It still does for error_at and this one call to
fatal_error.  These may be the last thing we need to fix--at least, I
can't think of anything else.

Ian
diff mbox

Patch

diff -r ff40d0d71cce go/go.cc
--- a/go/go.cc	Fri Jan 30 07:56:16 2015 -0800
+++ b/go/go.cc	Fri Jan 30 08:03:27 2015 -0800
@@ -63,7 +63,8 @@ 
 	{
 	  file = fopen(filename, "r");
 	  if (file == NULL)
-	    fatal_error("cannot open %s: %m", filename);
+	    fatal_error(Linemap::unknown_location(),
+			"cannot open %s: %m", filename);
 	}
 
       Lex lexer(filename, file, ::gogo->linemap());