From patchwork Thu Sep 2 00:41:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 63430 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]) by ozlabs.org (Postfix) with SMTP id B8C14B7152 for ; Thu, 2 Sep 2010 10:42:20 +1000 (EST) Received: (qmail 32637 invoked by alias); 2 Sep 2010 00:42:18 -0000 Received: (qmail 32629 invoked by uid 22791); 2 Sep 2010 00:42:17 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_CC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Sep 2010 00:42:10 +0000 Received: from wpaz24.hot.corp.google.com (wpaz24.hot.corp.google.com [172.24.198.88]) by smtp-out.google.com with ESMTP id o820g6Ae006318 for ; Wed, 1 Sep 2010 17:42:07 -0700 Received: from pzk7 (pzk7.prod.google.com [10.243.19.135]) by wpaz24.hot.corp.google.com with ESMTP id o820g5bb017465 for ; Wed, 1 Sep 2010 17:42:05 -0700 Received: by pzk7 with SMTP id 7so3799112pzk.41 for ; Wed, 01 Sep 2010 17:42:05 -0700 (PDT) Received: by 10.114.113.14 with SMTP id l14mr9752776wac.9.1283388125138; Wed, 01 Sep 2010 17:42:05 -0700 (PDT) Received: from coign.google.com ([66.109.106.2]) by mx.google.com with ESMTPS id r37sm12928169wak.23.2010.09.01.17.42.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Sep 2010 17:42:04 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: [gccgo] Change location of cast Date: Wed, 01 Sep 2010 17:41:54 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes 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 This small gccgo patch changes the location of a cast T(v) from the start of the type to the left parenthesis. This is mainly for convenience of the testsuite, and should be just as good if not better for humans. Ian diff -r 21b3034688ff go/parse.cc --- a/go/parse.cc Wed Sep 01 17:38:32 2010 -0700 +++ b/go/parse.cc Wed Sep 01 17:39:58 2010 -0700 @@ -2503,6 +2503,7 @@ ret = this->composite_lit(ret->type(), ret->location()); else if (this->peek_token()->is_op(OPERATOR_LPAREN)) { + source_location loc = this->location(); this->advance_token(); Expression* expr = this->expression(PRECEDENCE_NORMAL, false, true, NULL); @@ -2512,7 +2513,7 @@ this->advance_token(); if (expr->is_error_expression()) return expr; - ret = Expression::make_cast(ret->type(), expr, ret->location()); + ret = Expression::make_cast(ret->type(), expr, loc); } }