[patch i386]: For 4.6 add support of thiscall calling convention attribute for x86

Basile Starynkevitch basile@starynkevitch.net
Sat Mar 20 13:02:00 GMT 2010


Kai Tietz wrote:
>>
>>>        if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type)))
>>>       regno = aggr ? DX_REG : CX_REG;
>>> +      else if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (type)))
>>> +     regno = aggr ? DX_REG : CX_REG;
>>>        else
>>  That's a bit cut-n-pastey, how about one if that ORs the two conditions and
>> only one assignment?  (As I see you did it below in x86_output_mi_thunk.)
> 
> Well, duplicated it here by intention. I am not absolutely sure here,
> if description provided by MS documentation covers here the same
> behavior as for stdcall when aggregate is set.

Then I suggest adding a big fat comment warning about that. Otherwise, 
most people won't be able to understand your code.

Cheers

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***



More information about the Gcc-patches mailing list