[cfe-commits] [Windows] Use thiscall as the default calling convention for class methods

Timur Iskhodzhanov timurrrr at google.com
Mon Jul 9 06:52:43 PDT 2012


On Sat, Jul 7, 2012 at 10:44 AM, John McCall <rjmccall at apple.com> wrote:
> On Jun 28, 2012, at 1:39 PM, Timur Iskhodzhanov wrote:
>> Part one is attached - it propagates the "isInsance" boolean to the
>> two places where it should be read afterwards [in part 2].
>
> I didn't really like this approach, so I committed a different one as r159893.
> Let me know if this helps.
You've meant r159894.
Yeah, I like your approach much more than mine :)

>> The only logic change is around lib/CodeGen/CGCall.cpp:150.
>> Without this change, the definition of `void __cdecl cdecl_method() {}`
>> ends up using "thiscall" (and the call remains "cdecl" - ouch!).
>> Probably it was a bug in the first place.
>
> Let me know if this is still a problem arising in your second patch.
It still is!
See the FIXME in the attached patch.
Other than that, the tests pass OK and it was easy to achieve this.

>> Repeating the question I originally had:
>>  Can you please tell me if the extra isInstance bool parameter to
>>  arrangeFunctionType is fine or I should rather add this boolean
>>  into FunctionType::ExtInfo and set it in AST?
>
> The FunctionType should just preserve whether or not an explicit CC
> was set and should not try to infer instance-ness.
OK, sounds good.

> John.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_12785p2.patch
Type: application/octet-stream
Size: 7138 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120709/31553c50/attachment.obj>


More information about the cfe-commits mailing list