[llvm-commits] [llvm] r43988 - in /llvm/trunk: lib/Target/TargetCallingConv.td lib/Target/X86/X86CallingConv.td utils/TableGen/CallingConvEmitter.cpp

Dale Johannesen dalej at apple.com
Sun Nov 11 09:23:57 PST 2007


On Nov 11, 2007, at 3:25 AM, Duncan Sands wrote:

> Hi Dale,
>
>> Add CCAssignToStackABISizeAlign for convenience in
>> dealing with types whose size & alignment are
>> different on different subtargets.  Use it for x86 f80.
>
> it's really not possible to have the size and alignment be optional
> arguments to CCAssignToStack?

It may not be impossible, but I couldn't get it to work.

>> +/// CCAssignToStackABISizeAlign - This action always matches: it  
>> assigns
>> +/// the value to a stack slot of the ABISize and ABIAlignment for  
>> the type,
>> +/// which may depend on the target or subtarget.
>> +/// "ignored" is here because an empty arg list does not work.
>> +class CCAssignToStackABISizeAlign<int ignored> : CCAction {
>
> Maybe it should take the type as the argument?  Even if it's not used
> it seems more logical to have CCAssignToStackABISizeAlign<f80>, since
> the ABI size and alignment are for that type.

It seems to me "take the known size and alignment from the type you  
already have"
is a useful and widely applicable abstraction, less fragile than  
what's there now.
I.e., I'm looking at it one level up, where you have

  CCIfType<[f80], CCAssignToStackABISizeAlign<0>>

So I like it this way (except for the annoying wart of the "ignored"  
argument, maybe
somebody knows a way around that?)




More information about the llvm-commits mailing list