From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96552 invoked by alias); 15 Sep 2015 10:20:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 96539 invoked by uid 89); 15 Sep 2015 10:20:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 15 Sep 2015 10:20:51 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D3176461D8; Tue, 15 Sep 2015 10:20:49 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8FAKl2b016324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 15 Sep 2015 06:20:49 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id t8FAKk9l003599; Tue, 15 Sep 2015 12:20:46 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id t8FAKjAv003597; Tue, 15 Sep 2015 12:20:45 +0200 Date: Tue, 15 Sep 2015 10:28:00 -0000 From: Jakub Jelinek To: Richard Biener Cc: David Malcolm , GCC Patches Subject: Re: [PATCH 07/22] Implement token range tracking within libcpp and C/C++ FEs Message-ID: <20150915102045.GB1847@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <1441916913-11547-1-git-send-email-dmalcolm@redhat.com> <1441916913-11547-8-git-send-email-dmalcolm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg01042.txt.bz2 On Tue, Sep 15, 2015 at 12:14:22PM +0200, Richard Biener wrote: > > diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h > > index 760467c..c7558a0 100644 > > --- a/gcc/cp/parser.h > > +++ b/gcc/cp/parser.h > > @@ -61,6 +61,8 @@ struct GTY (()) cp_token { > > BOOL_BITFIELD purged_p : 1; > > /* The location at which this token was found. */ > > location_t location; > > + /* The source range at which this token was found. */ > > + source_range range; > > Is it just me or does location now feel somewhat redundant with range? Can't we > compress that somehow? For a token I'd expect it is redundant, I don't see how it would be useful for a single preprocessing token to have more than start and end locations. But generally, for expressions, 3 locations make sense. If you have abc + def ~~~~^~~~~ then having a range is useful. In any case, I'm surprised that the ranges aren't encoded in location_t (the data structures behind it, where we already stick also BLOCK pointer). Jakub