From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7934 invoked by alias); 12 Sep 2011 20:04:55 -0000 Received: (qmail 7920 invoked by uid 22791); 12 Sep 2011 20:04:52 -0000 X-SWARE-Spam-Status: No, hits=-6.7 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; Mon, 12 Sep 2011 20:04:34 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8CK48rb021559 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Sep 2011 16:04:08 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8CK46RM018925; Mon, 12 Sep 2011 16:04:06 -0400 Received: from [0.0.0.0] (ovpn-113-157.phx2.redhat.com [10.3.113.157]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p8CK43Ja018273; Mon, 12 Sep 2011 16:04:03 -0400 Message-ID: <4E6E65B2.2060909@redhat.com> Date: Mon, 12 Sep 2011 21:15:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: Dodji Seketeli 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 2/7] Generate virtual locations for tokens References: <1291979498-1604-1-git-send-email-dodji@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00746.txt.bz2 On 08/09/2011 10:54 AM, Dodji Seketeli wrote: > + goto ftrack_macro_expansion_with_arg; > + > + case OPT_ftrack_macro_expansion_: > + ftrack_macro_expansion_with_arg: Instead of the goto, just write /* Fall through. */ > +consumption if necessary. Value @samp{0} of @var{level} de-activates > +this option just as if no @option{-ftrack-macro-expansion} was present > +on the command line. Value @samp{1} tracks tokens locations in a > +degraded mode for the sake of minimal memory overhead. In this mode > +all tokens resulting from the expansion of an argument of a > +function-like macro have the same location. Value @samp{2} tracks > +tokens locations completely. This value is the most memory hungry. It > +is the default value. "It is the default value" sounds to me like no -ftrack-macro-expansion option is equivalent to -ftrack-macro-expansion=2, rather than =0. > + expansion of arguments of function-like macro. all macro > + expansion. 2 Means we do track all macro expansions. This last Seems like the "all macro expansion" is left over from a previous version of this sentence. > +/* This describes some additional data that is added to the macro > + token context of type cpp_context, when -ftrack-macro-expansion is > + on. */ > +typedef struct > +{ > + /* The node of the macro we are referring to. */ > + cpp_hashnode *macro_node; > + /* This buffer contains an array of virtual locations. The virtual > + location at index 0 is the virtual location of the token at index > + 0 in the current instance of cpp_context; similarly for all the > + other virtual locations. */ > + source_location *virt_locs; > + /* This is a pointer to the current virtual location. This is used > + to iterate over the virtual locations while we iterate over the > + tokens they belong to. */ > + source_location *cur_virt_loc; > +} macro_context; Why track virtual locations separately rather than use them directly as the src_loc of the tokens? Jason