* Go patch committed: Use backend interface for error detection
@ 2014-05-01 1:20 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2014-05-01 1:20 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 427 bytes --]
This patch from Chris Manghane changes the Go frontend to use the
backend interface to detect whether any errors have been seen.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.
Ian
2014-04-30 Chris Manghane <cmang@google.com>
* go-backend.c: #include "diagnostics.h".
(saw_errors): New function.
* go-c.h (saw_errors): Declare.
* Make-lang.in (GO_OBJS): Remove go/gogo-tree.o.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 2551 bytes --]
Index: gcc/go/Make-lang.in
===================================================================
--- gcc/go/Make-lang.in (revision 209392)
+++ gcc/go/Make-lang.in (working copy)
@@ -60,7 +60,6 @@ GO_OBJS = \
go/go-linemap.o \
go/go-optimize.o \
go/go.o \
- go/gogo-tree.o \
go/gogo.o \
go/import.o \
go/import-archive.o \
Index: gcc/go/gofrontend/gogo-tree.cc
===================================================================
--- gcc/go/gofrontend/gogo-tree.cc (revision 209392)
+++ gcc/go/gofrontend/gogo-tree.cc (working copy)
@@ -1,37 +0,0 @@
-// gogo-tree.cc -- convert Go frontend Gogo IR to gcc trees.
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#include "go-system.h"
-
-#include "toplev.h"
-#include "tree.h"
-#include "stringpool.h"
-#include "stor-layout.h"
-#include "varasm.h"
-#include "gimple-expr.h"
-#include "gimplify.h"
-#include "tree-iterator.h"
-#include "cgraph.h"
-#include "langhooks.h"
-#include "convert.h"
-#include "output.h"
-#include "diagnostic.h"
-#include "go-c.h"
-
-#include "types.h"
-#include "expressions.h"
-#include "statements.h"
-#include "runtime.h"
-#include "backend.h"
-#include "gogo.h"
-
-// Whether we have seen any errors.
-
-bool
-saw_errors()
-{
- return errorcount != 0 || sorrycount != 0;
-}
Index: gcc/go/go-backend.c
===================================================================
--- gcc/go/go-backend.c (revision 209392)
+++ gcc/go/go-backend.c (working copy)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.
#include "output.h" /* for assemble_string */
#include "target.h"
#include "common/common-target.h"
+#include "diagnostic.h"
#include "go-c.h"
@@ -48,6 +49,14 @@ along with GCC; see the file COPYING3.
/* This file holds all the cases where the Go frontend needs
information from gcc's backend. */
+/* Return whether or not GCC has reported any errors. */
+
+bool
+saw_errors (void)
+{
+ return errorcount != 0 || sorrycount != 0;
+}
+
/* Return the alignment in bytes of a struct field of type T. */
unsigned int
Index: gcc/go/go-c.h
===================================================================
--- gcc/go/go-c.h (revision 209945)
+++ gcc/go/go-c.h (working copy)
@@ -46,6 +46,8 @@ extern void go_write_globals (void);
extern void go_preserve_from_gc (tree);
+extern bool saw_errors (void);
+
extern const char *go_localize_identifier (const char*);
extern unsigned int go_field_alignment (tree);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-01 1:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01 1:20 Go patch committed: Use backend interface for error detection Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).