[LLVMdev] GEPping GEPs and first-class structs

Dan Gohman gohman at apple.com
Mon Feb 2 11:20:43 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
> 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.

Dan




More information about the llvm-dev mailing list