[cfe-dev] how to mapping from struct index to name

Daniel Dunbar daniel at zuster.org
Tue Apr 27 08:04:13 PDT 2010


Ah, this explains later message.

Why do you want to do this? Are you prepared to handle bit-fields?

 - Daniel

On Mon, Apr 26, 2010 at 11:04 AM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote:
> Hi!
>
> How can I find out the mapping between structure element names and index
> used
> in getelementptr?
> If I have the following program:
>
> struct Foo
> {
>     int i;
>     float j;
> };
>
> Foo foo;
>
> void main()
> {
>     foo.j = 1.0f
> }
>
> I get an instruction containing getelementptr (%Foo* @foo, i32 0, i32 1)
> Member i is at index 0 and member j is at index 1.
> This is what I want to find out.
> Perhaps it can be done using debug info?
>
> -Jochen
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list