On Jul 7, 2007, at 9:17 AM, Reid Spencer wrote:

> Hi Duncan,
>
> On Sat, 2007-07-07 at 12:24 +0200, Duncan Sands wrote:
>> Hi Reid,
>>
>>>> +    ByVal             = 1<<4,  ///< Struct passed by value
>>>
>>> I would prefer this be named StructByVal, to be clear
>>
>> this was changed because it should also be possible to pass arrays
>> by value, not just structs.  So it is rather the comment that should
>> be fixed, not the name.  That said, ByVal is a little confusing since
>> eg an integer is passed by value but is not marked ByVal.  Not clear
>> what a better name would be...
>
> Okay, so now I'm really confused. :)
>
> The Verifier is checking to make sure that the argument type to which
> ByVal is applied is a pointer. It doesn't check any further so I  
> assume
> a pointer to anything is valid. So, consider the following:
>
> 1. i32*              ; i32 is passed?
> 2. i1024*            ; We pass a 128-byte long integer?
> 3. f64*              ; We pass a double?
> 4. {i32,i32,i32}*    ; We pass 3 i32 integers?
> 5. <4xi32>*          ; We pass 4 i32 integers?
> 6. [1024xi32]*       ; We pass 1024 i32 integers?

Yes, all of these should be passable byval.

-Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to