[cfe-dev] RFC: Flesh out the IRGen C++ ABI class
John McCall
rjmccall at apple.com
Mon Oct 25 22:02:48 PDT 2010
On Oct 25, 2010, at 9:28 PM, John McCall wrote:
>
> On Oct 25, 2010, at 6:51 PM, Charles Davis wrote:
>
>> On 10/25/10 6:34 AM, Charles Davis wrote:
>>> On 10/25/10 2:34 AM, John McCall wrote:
>>>> We'll also need some hook to override the default calling convention for
>>>> instance methods.
>>> True. The Sema CXXABI object also needs one, by the way.
>> And I just realized. The getCanonicalCallConv() function turns CC_C into
>> CC_Default. The problem is that for methods on x86 in the Microsoft ABI,
>> CC_Default is the same as CC_X86ThisCall. I could just add a parameter
>> to getCanonicalCallConv() to have it call the CXXABI hook, but then I
>> need to know when to pass 'true' to get the right behavior.
>>
>> The two places where getCanonicalCallConv() are called where this
>> matters are ASTContext::getFunctionType() in lib/AST/ASTContext.cpp and
>> ProcessFnAttr() in lib/Sema/SemaType.cpp. This is important so we get
>> the right semantic analysis. Any ideas?
>
> My inclination is to say that "canonicalizing" the function type is the wrong thing to do,
s/function type/calling convention/
John.
More information about the cfe-dev
mailing list