[LLVMdev] Two new 'llvmnotes'

Talin viridia at gmail.com
Mon May 5 01:13:00 PDT 2008


Chris Lattner wrote:
> Aggregates as First Class Values:
> http://nondot.org/sabre/LLVMNotes/FirstClassAggregates.txt
>   
Thinking more about this...I kinda wish it was available right *now*, 
because I sure could use it. I've been working on functions returning 
structures today, and in the current IR I basically have two choices: 
Either return the struct using multiple return values (which means 
flattening any nested structs inside the struct to be returned, since 
AFAICT return values have to be first class, and then re-assembling the 
structure at the call site), or passing an extra argument which points 
to the struct to be filled in.

In my opinion, that's a level of detail that the frontend really 
shouldn't have to know or care about. The code generator should be able 
to make that decision based on the platform ABI and other 
target-specific criteria, and the frontend has no business worrying 
about any of these issues.

-- Talin




More information about the llvm-dev mailing list