[LLVMdev] GEPping GEPs and first-class structs

Chris Lattner clattner at apple.com
Mon Feb 2 11:25:46 PST 2009


On Feb 1, 2009, at 5:38 AM, Jon Harrop wrote:

>
> As I understand it, first-class structs will allow structs to be  
> passed as

first-class structs already exist. :)

>
> function arguments and returned as results (i.e. multiple return  
> values)
> instead of passing pointers to structs. However, the GEP instruction  
> only
> handles pointer types. So I do not understand how you will be able  
> to extract
> the fields of a struct when it is received as a value type.

Use the extractvalue instruction.

> Will the GEP instruction be altered so that it can be applied to  
> structs
> directly?

No.

-Chris



More information about the llvm-dev mailing list