From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15312 invoked by alias); 20 Sep 2011 07:23:54 -0000 Received: (qmail 15299 invoked by uid 22791); 20 Sep 2011 07:23:52 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Sep 2011 07:23:34 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8K7N95E013546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Sep 2011 03:23:09 -0400 Received: from localhost (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8K7N61K015718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Sep 2011 03:23:08 -0400 Received: by localhost (Postfix, from userid 500) id DC2C629C111; Tue, 20 Sep 2011 09:23:05 +0200 (CEST) From: Dodji Seketeli To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, tromey@redhat.com, gdr@integrable-solutions.net, joseph@codesourcery.com, burnus@net-b.de, charlet@act-europe.fr, bonzini@gnu.org Subject: Re: [PATCH 3/7] Emit macro expansion related diagnostics References: <1291979498-1604-1-git-send-email-dodji@redhat.com> <7ab852c58faea9efd81130c5a1ddc9e78b34bcc5.1310824121.git.dodji@redhat.com> <4E6E73F8.4030603@redhat.com> <4E74AA75.8090106@redhat.com> <4E778A26.1000707@redhat.com> <4E77ACA1.80205@redhat.com> X-URL: http://www.redhat.com Date: Tue, 20 Sep 2011 08:47:00 -0000 In-Reply-To: <4E77ACA1.80205@redhat.com> (Jason Merrill's message of "Mon, 19 Sep 2011 16:57:05 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2011-09/txt/msg01129.txt.bz2 Jason Merrill writes: > It is sounding to me like the first location (xI) gets you the next > virtual location in the unwinding process, whereas the second location > (yI) gets you the spelling location of the token in the definition of > a macro. Right. > Certainly all the calls to tokens_buff_add_token pass src->src_loc for > the second. So why don't we look up the second location in the macro > definition when we need it rather than store a copy in the map? Because when you have the first location, looking up the second is not easy. Note that the information about the arguments of a function-like macro is freed right in enter_macro_context by delete_macro_args once we have recorded the locations for the macro expansion. Getting the src that matches the loc of a token coming from an argument of the macro expansion, once that argument has been freed is not easier than just storing a copy of the src->src_loc we need. So Tom and I decided to let that optimization for later once we are sure the whole thing works and performs well enough. -- Dodji