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