[PATCH] Bug 14984 - Implement __attribute__((ms_abi))
rnk at google.com
Wed Jun 12 05:40:13 PDT 2013
On Wed, Jun 12, 2013 at 7:13 AM, Charles Davis <cdavis5x at gmail.com> wrote:
> On Jun 11, 2013, at 4:05 PM, Reid Kleckner wrote:
> On Tue, Jun 11, 2013 at 5:52 PM, Richard Smith <richard at metafoo.co.uk>wrote:
>> On Tue, Jun 11, 2013 at 3:44 AM, Benno Rice <benno at freebsd.org> wrote:
>> > Hi all,
>> > I've attached a patch to the bug at:
>> > http://llvm.org/bugs/show_bug.cgi?id=14984
>> > that implements the necessary glue to support __attribute__((ms_abi)).
>> > If anyone has any questions, please let me know off-list.
> Does gcc intend for ms_abi to cover other ABI areas like struct layout?
>> It's not clear to me that representing this as a separate calling
>> convention in Clang is the right approach. We support at least four
>> different calling conventions when targeting the MS ABI (__cdecl,
>> __fastcall, __stdcall, __thiscall); perhaps this attribute should be
>> mapped to the appropriate member from that set? What should
>> __attribute__((ms_abi)) do when we're targeting the MS ABI already?
>> (Do you get a canonically-different type, or the same type, or is it
>> an error?)
> What's lacking today is a way to get at the win64 convention in Clang or
> from LLVM when targetting a non-Windows platform. LLVM might want to have
> a different internal name that's less vague that "ms_abi", though.
> You mean like in my patch here:
Yeah, that looks good to me. :)
>From the docs, it seems attr(ms_abi) just maps to x86_64_win64cc and
x86_stdcallcc depending on the architecture:
gcc also appears to support a sysv_abi attribute, which lets you use the
sysv CCs when targeting Windows.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits