[LLVMdev] Structs as first class values.

Chris Lattner clattner at apple.com
Sun Jul 20 10:35:12 PDT 2008


On Jul 20, 2008, at 6:25 AM, Richard Pennington wrote:

> Hi,
>
> I'm trying to implement structs as first class values. If I assemble
>
> It assembles without complaint.

Yep, the code looks fine.

> If I do llc I get an assert:
>
>
> My questions are:
>
>  Is this supposed to work? (I understand it may be a work in  
> progress.)

Yes, that is supposed to work in theory.  In practice, most targets  
only support returning up to two values in registers.  Eventually, we  
want the code generator to support returning excess return values on  
the stack, but we don't have that code yet.

>  Is the LLVM well formed at the source level?

Yep, this is just a limitation of the current code generators.  Prior  
to first-class aggregate support, we did have MRV support, which has  
the same limitation so far.

-Chris



More information about the llvm-dev mailing list