[llvm-commits] [llvm] r37940 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h include/llvm/ParameterAttributes.h lib/AsmParser/Lexer.l lib/AsmParser/llvmAsmParser.y lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/TargetCallingConv.td lib/Target/X86/X86CallingConv.td lib/VMCore/Function.cpp lib/VMCore/Verifier.cpp utils/TableGen/CallingConvEmitter.cpp
Chris Lattner
clattner at apple.com
Mon Jul 16 23:03:08 PDT 2007
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
More information about the llvm-commits
mailing list