r197584 - Implement the MSABI and SysVABI calling conventions for Objective-C method declarations. This appears to be an omission from r189644.

Aaron Ballman aaron at aaronballman.com
Wed Dec 18 09:54:04 PST 2013


On Wed, Dec 18, 2013 at 12:49 PM, Charles Davis <cdavis5x at gmail.com> wrote:
>
> On Dec 18, 2013, at 9:23 AM, Aaron Ballman wrote:
>
>> Author: aaronballman
>> Date: Wed Dec 18 10:23:37 2013
>> New Revision: 197584
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=197584&view=rev
>> Log:
>> Implement the MSABI and SysVABI calling conventions for Objective-C method declarations. This appears to be an omission from r189644.
> It was intentional.

Then there's no need for these attributes to have an AST node because
they're not actually used anywhere, aside from here.

> I didn't think anyone would want or need to use any calling convention with an Objective-C method other than the default.

I'm a bit surprised by that as well, truth be told. But since every
other calling convention is represented, omitting these two smells
like a bug.

> And I still don't understand why you'd want to use a different calling convention. The methods are always called indirectly, by the objc_msgSend() family (at least, on NeXT-style runtimes), and the IMP function pointer typedef that it uses has the default calling convention. Any time the message for that method gets sent, the method implementation will get called with the wrong convention. Unless there's some way to communicate the correct calling convention back to the runtime, I think we should go back to disallowing calling convention attributes on Objective-C methods.

This is definitely something worth exploring. I don't know enough
about Obj-C to have much of an opinion. If we do remove calling
conventions from Obj-C methods, be sure to set ASTNode = 0 for each of
the CC attributes. :-)

~Aaron




More information about the cfe-commits mailing list