This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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} ***


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]