From patchwork Thu May 1 01:20:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 344389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 12BE8140112 for ; Thu, 1 May 2014 11:20:35 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=V6TxEos6H7UE300Kgc+QLFdZJSesdKSQYk15SAwoRn2xsFASVKkv5 UO9Vgapf27IEd5Ssn6SEKbW3j1VLnwElAYVMRDNmWp0pVpARMJc7wmvkuSRe5vZM O8c76MnNQVvlGxoYlYRnPHeZw7gvunyoD1/v0dPzgf0TSQ9kWzn9JE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=7ZIlEjGtcYnmUMW3hYeUMXIEpcs=; b=D3HUOacPdew+WoB0f5g8 xdbl+6LV04UUpBDXXIS7pOCOHR3P4CMHqe1otTzsgHODbpD6uCPfu01N/U35bSxG w0RevJ9MtgbuU7C8o70HSKR6P6hR4ROTTuOjG/c/tH54/KUK5jwg2LES6ZFYiGTj SO6R6EhmcC9jwdY/v/Ya4rA= Received: (qmail 20822 invoked by alias); 1 May 2014 01:20:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20810 invoked by uid 89); 1 May 2014 01:20:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f178.google.com Received: from mail-qc0-f178.google.com (HELO mail-qc0-f178.google.com) (209.85.216.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 01 May 2014 01:20:17 +0000 Received: by mail-qc0-f178.google.com with SMTP id i8so2774502qcq.37 for ; Wed, 30 Apr 2014 18:20:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=bwDgdXLuafisTBhfcJRnnCMbZ6/uY42xNzkdBVOSakY=; b=QTycB44IqImT6GpzFXtOjxspO4qZzs4/kVuVZeRalAcknbGgsRnA8fyL+9jlKFJRDP VSnRx12JGxGRjMnwh2n7tt0Mr+TvSoo843iBsNIeGXXsKswZUhMo8GyBIewMhCWI4Ozl j0/Z3Zk5U26zdKSh1obPE3+8XTF641IIo6sGkrgpsw41H+ZEyYlLnfqKuAVqAlFvchHw mYidJCEgANPFk0o9p2sPY7ZLfdtd6Kj1Y5gCjHpAI+I/1OxwoqWeaHuxVggbzJvNyzj2 QNo8VRKzelhdmE+4YrJ2TaRWpVyRGYWAGvtZ/XtkRJfXdlVf15/v9kLTQq7DW1tXCt+E lX8g== X-Gm-Message-State: ALoCoQm0Mv9MgAZky9FvtDt0+V7f2/hjsyuGmf7JKXQoitvkVwISrlFR0eifTsTvafnr/CArVIsP X-Received: by 10.140.85.102 with SMTP id m93mr9512261qgd.26.1398907215083; Wed, 30 Apr 2014 18:20:15 -0700 (PDT) Received: from iant-glaptop.roam.corp.google.com.google.com (rrcs-24-39-145-115.nyc.biz.rr.com. [24.39.145.115]) by mx.google.com with ESMTPSA id n105sm33064019qgd.7.2014.04.30.18.20.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 30 Apr 2014 18:20:14 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Use backend interface for error detection Date: Wed, 30 Apr 2014 21:20:13 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes 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 * 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. 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);