[LLVMdev] Two new 'llvmnotes'

Chris Lattner sabre at nondot.org
Wed May 7 10:58:41 PDT 2008


On Wed, 7 May 2008, Matthijs Kooijman wrote:
>> Aggregates as First Class Values:
> it seems to me that having this would make the byval parameter attribute
> partly obsolete? Will there be semantic differences between passing a struct
> directly and a pointer to a struct byval?
>
> I can see that byval can be used on pointers to other things, but is that
> really useful? I can't see any use for compiling C code, are there other
> languages that have a direct use  for a byval attribute?

Byval and passing a first class aggregate have the same semantics. 
However, byval is very efficient for large aggregates and first-class 
aggregates is efficient for small ones.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list