compiler: better abstraction layer for diagnostics.
authorThan McIntosh <thanm@google.com>
Fri, 23 Sep 2016 19:36:45 +0000 (19:36 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 23 Sep 2016 19:36:45 +0000 (19:36 +0000)
commit56bafc49a02cbff82b628e83c35e36d1872fdcc8
treea45167990fa1fe860cc44939f3ec887785089c27
parent34a594e85618002815e2faf3b515ba1d7446a55b
compiler: better abstraction layer for diagnostics.

    Introduce an abstraction layer for reporting diagnostics, so as to avoid
    directly using the native GCC interfaces such as "error_at",
    "warning_at", "open_quote", "close_quote", etc.  The new interfaces have
    the same look and feel as the GCC equivalents, but make calls into
    back-end functions to allow the back end to select the proper final
    reporting routine.

    Reviewed-on: https://go-review.googlesource.com/29191

* go-gcc-diagnostics.cc: New file.
* go-location.h (Location): Remove operator source_location.  Add
operator==.
* go-system.h: #include <sstream>.
* Make-lang.in (GO_OBJS): Add go/go-diagnostics.o and
go/go-gcc-diagnostics.o.
(CFLAGS-go/go-gcc-diagnostics.o): New variable.

From-SVN: r240453
22 files changed:
gcc/go/ChangeLog
gcc/go/Make-lang.in
gcc/go/go-gcc-diagnostics.cc [new file with mode: 0644]
gcc/go/go-location.h
gcc/go/go-system.h
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/ast-dump.cc
gcc/go/gofrontend/backend.h
gcc/go/gofrontend/escape.cc
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/go-diagnostics.cc [new file with mode: 0644]
gcc/go/gofrontend/go-diagnostics.h [new file with mode: 0644]
gcc/go/gofrontend/go.cc
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/import-archive.cc
gcc/go/gofrontend/import.cc
gcc/go/gofrontend/lex.cc
gcc/go/gofrontend/parse.cc
gcc/go/gofrontend/parse.h
gcc/go/gofrontend/statements.cc
gcc/go/gofrontend/statements.h
gcc/go/gofrontend/types.cc