On 25/02/2011 19:21, Kyle Girard wrote:

> I was hoping to see the assignment.

> Looking at the gimple output there is no way to see that 'a' was
> assigned in bar().  So that it can be used in wik().  Am I
> misunderstanding something shouldn't there be a way to see the
> assignment in bar?  Do I have to parse the expression statement or are
> things already optimized away and there is no way to get the information
> that I seek.

  Ah, right.  Yes, the stuff you see at the GIMPLE level has already been
substantially processed compared to the original AST - operations decomposed,
constants folded, that kind of thing.  For instance if (like Andrew suggests)
we add a "int x;" declaration in class A from your original example, we get:

> void foo::bar(A&) (struct foo * const this, struct A & aa)
> {
>   this->a = MEM[(const struct A &)aa];
> }

  You probably need to look earlier than GIMPLE time.  What plugin event are
you hooking?

    cheers,
      DaveK

Reply via email to