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

Jochen Wilhelmy j.wilhelmy at arcor.de
Mon Apr 26 11:04:43 PDT 2010


How can I find out the mapping between structure element names and index 
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?


More information about the cfe-dev mailing list