[cfe-dev] RFC: Flesh out the IRGen C++ ABI class

Charles Davis cdavis at mymail.mines.edu
Mon Oct 25 18:51:23 PDT 2010


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?

Chip



More information about the cfe-dev mailing list