From patchwork Thu Oct 12 19:01:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 825036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-464061-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="I6KYADhD"; dkim-atps=neutral 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 3yCgFf0thvz9sNw for ; Fri, 13 Oct 2017 06:02:13 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=eldMWYYTtX+GwK0251oROnRAJEDXvIzYLiMpFnT9AW7oho jcz0Do20IudyeqfTo+CCBo3rRPiE3Xxw8BrapadDxAPjyd623bRrOTUYewq0InPc J7KOWTde9T7ZeIb6lqt0UT5E7V4MFklo7S8cvWniAcmTDyuIE/eO5cBePD4yE= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=zLGafhIbspTYlmhJMZveMgqAqUk=; b=I6KYADhDvoyx2f4uma5H Li77Sck3PDaUU3Y97sjgfeFd8FG5LJkFa38s6ctBUZdn/vpoLcSoivJkN38Bztr5 2fkOLWWSveVcbzv5riUaBzJI/COOkAzYqdyoIi8FLbNiOesrm23uwMrJD1irxk/s ILKc2cCmKECTQ59u7SXxJ8M= Received: (qmail 34779 invoked by alias); 12 Oct 2017 19:02:05 -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 34764 invoked by uid 89); 12 Oct 2017 19:02:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=exporter X-HELO: mail-wm0-f51.google.com Received: from mail-wm0-f51.google.com (HELO mail-wm0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Oct 2017 19:01:57 +0000 Received: by mail-wm0-f51.google.com with SMTP id u138so15686199wmu.5 for ; Thu, 12 Oct 2017 12:01:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LrI2EZdcD+RdxpyeRtL/jVvQ1AOfHGYUaUz+0fK9U3o=; b=gJ+Wv3PO4VOTH+5XU56HhPA+LRNqgNvCMOYV6nwZ1RbBdAxSp8mHwMN3GaSzYaaeh5 6aYRvJ9M9cgxMhPPgg7Ha/YlXl47qvPIVHEwRvYjJ2oRI86hk9v9rrbePe4qh55HK/rG Aq9Bqs/oSOUU9kARUL807YfDSrMgUzoHWummsHujZuWMwfSgSKxtXg4fATDSgNV8eT8D D9CgqKp8JnmJ0I0uzKstudOoIje34FxEDoy5v7zbjGFxYsrAcRhFp8yoIRD7RNz3MNOF wgXAAWV4JSQY9NaUmIHCL3EqFH9EtB3R1P7iw/p6HTxQe08UOZMlgiu2LG1DIAQGcMhp qWgA== X-Gm-Message-State: AMCzsaWE65gFIEO3xEOP0OHV2olpS/LpoGkvoWf0xqJRZmPZG7iCdCIP V8Mne/jSDHq4DhB9j63sU1dZkk9QPbSSUc6kaEueQLq6 X-Google-Smtp-Source: AOwi7QAn1d7RZgkckcR3O1q8q4VuR2hpK6Getz8pUGOTnY6lwXjLzAzsfDm1qCBuoMzNfwrt/vflVIcWPvS7mJZsD6A= X-Received: by 10.80.153.196 with SMTP id n4mr3916257edb.28.1507834915209; Thu, 12 Oct 2017 12:01:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.179.240 with HTTP; Thu, 12 Oct 2017 12:01:54 -0700 (PDT) From: Ian Lance Taylor Date: Thu, 12 Oct 2017 12:01:54 -0700 Message-ID: Subject: Go patch committed: Fix import of indirectly imported type alias To: gcc-patches , "gofrontend-dev@googlegroups.com" When the Go frontend imported a reference to an indirectly imported type aliases, it was looking for the " = " before the optional package name that appears for an indirect reference, but the exporter was putting it after. This patch fixes that. The test case is https://golang.org/cl/70290, and will be brought into the GCC testsuite in due course. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 253664) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -af46ad16dc34773877068393d331ac8ae34b2219 +44132970e4b6c1186036bf8eda8982fb6e905d6f The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/import.cc =================================================================== --- gcc/go/gofrontend/import.cc (revision 253311) +++ gcc/go/gofrontend/import.cc (working copy) @@ -756,13 +756,6 @@ Import::read_type() this->require_c_string(" "); - bool is_alias = false; - if (this->match_c_string("= ")) - { - stream->advance(2); - is_alias = true; - } - // The package name may follow. This is the name of the package in // the package clause of that package. The type name will include // the pkgpath, which may be different. @@ -775,6 +768,13 @@ Import::read_type() this->require_c_string(" "); } + bool is_alias = false; + if (this->match_c_string("= ")) + { + stream->advance(2); + is_alias = true; + } + // Declare the type in the appropriate package. If we haven't seen // it before, mark it as invisible. We declare it before we read // the actual definition of the type, since the definition may refer