aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-location.h
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2016-09-23 19:36:45 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-09-23 19:36:45 +0000
commit56bafc49a02cbff82b628e83c35e36d1872fdcc8 (patch)
treea45167990fa1fe860cc44939f3ec887785089c27 /gcc/go/go-location.h
parent34a594e85618002815e2faf3b515ba1d7446a55b (diff)
downloadgcc-56bafc49a02cbff82b628e83c35e36d1872fdcc8.zip
gcc-56bafc49a02cbff82b628e83c35e36d1872fdcc8.tar.gz
gcc-56bafc49a02cbff82b628e83c35e36d1872fdcc8.tar.bz2
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
Diffstat (limited to 'gcc/go/go-location.h')
-rw-r--r--gcc/go/go-location.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/go/go-location.h b/gcc/go/go-location.h
index f2731d9..90258ea 100644
--- a/gcc/go/go-location.h
+++ b/gcc/go/go-location.h
@@ -26,10 +26,6 @@ class Location
gcc_location() const
{ return this->gcc_loc_; }
- // Temporary hack till error_at and warning_at can deal with a Location.
- operator source_location() const
- { return this->gcc_loc_; }
-
private:
source_location gcc_loc_;
};
@@ -42,4 +38,10 @@ operator<(Location loca, Location locb)
return loca.gcc_location() < locb.gcc_location();
}
+inline bool
+operator==(Location loca, Location locb)
+{
+ return loca.gcc_location() == locb.gcc_location();
+}
+
#endif // !defined(GO_LOCATION_H)