From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30624 invoked by alias); 7 Jul 2005 16:51:07 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 30597 invoked by uid 22791); 7 Jul 2005 16:51:03 -0000 Received: from h-68-164-203-246.noclli.covad.net (HELO dberlin.org) (68.164.203.246) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 07 Jul 2005 16:51:03 +0000 Received: from [127.0.0.1] (HELO localhost) by dberlin.org (CommuniGate Pro SMTP 4.3.4) with ESMTP id 8197321; Thu, 07 Jul 2005 12:50:42 -0400 Subject: Re: Existing tree functionality? From: Daniel Berlin To: Michael Tegtmeyer Cc: dnovillo@redhat.com, gcc@gcc.gnu.org In-Reply-To: References: <1120749653.7568.1.camel@IBM-82ZWS052TEN.watson.ibm.com> Content-Type: text/plain Date: Thu, 07 Jul 2005 16:51:00 -0000 Message-Id: <1120755041.7568.8.camel@IBM-82ZWS052TEN> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-07/txt/msg00280.txt.bz2 On Thu, 2005-07-07 at 12:40 -0400, Michael Tegtmeyer wrote: > > pass_init_datastructures is still necessary. > > That was the problem-thanks. > > New question (or still the original rather), is there existing > functionality to obtain the variables used in a function with external > visibility for that function-or in other words-any variable not local to > that function? is_global_vars() works for globals but misses: > > struct foo { > int i; > void bar() {i=10;} > }; > In bar, 'i' is not global but is not passed in via arguments either. > referenced_vars contains the 'this' ptr. i is not a regular variable here, it's a member of a structure. > Is there anything existing that > will obtain 'i' as an external variable w.r.t. bar? No, but only because it's not really a variable, it's a structure member, and only ever accessed as such. It thus doesn't appear as a VAR_DECL (in gcc terms), it appears in component accesses as a FIELD_DECL. > > Thanks again, > Mike