<div dir="ltr">On Wed, Jun 12, 2013 at 7:13 AM, Charles Davis <span dir="ltr"><<a href="mailto:cdavis5x@gmail.com" target="_blank">cdavis5x@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div class="h5">
<div>On Jun 11, 2013, at 4:05 PM, Reid Kleckner wrote:</div><br><blockquote type="cite"><div dir="ltr">On Tue, Jun 11, 2013 at 5:52 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>
<div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On Tue, Jun 11, 2013 at 3:44 AM, Benno Rice <<a href="mailto:benno@freebsd.org" target="_blank">benno@freebsd.org</a>> wrote:<br>


> Hi all,<br>
><br>
> I've attached a patch to the bug at:<br>
><br>
> <a href="http://llvm.org/bugs/show_bug.cgi?id=14984" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=14984</a><br>
><br>
> that implements the necessary glue to support __attribute__((ms_abi)).<br>
><br>
> If anyone has any questions, please let me know off-list.<br></div></blockquote><div><br></div><div>Does gcc intend for ms_abi to cover other ABI areas like struct layout?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div>
</div>It's not clear to me that representing this as a separate calling<br>
convention in Clang is the right approach. We support at least four<br>
different calling conventions when targeting the MS ABI (__cdecl,<br>
__fastcall, __stdcall, __thiscall); perhaps this attribute should be<br>
mapped to the appropriate member from that set? What should<br>
__attribute__((ms_abi)) do when we're targeting the MS ABI already?<br>
(Do you get a canonically-different type, or the same type, or is it<br>
an error?)</blockquote><div><br></div><div></div></div></div><div class="gmail_extra">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.</div>
</div></blockquote></div></div>You mean like in my patch here:</div><div><br></div><div><a href="http://llvm-reviews.chandlerc.com/D729" target="_blank">http://llvm-reviews.chandlerc.com/D729</a></div><div class="im"><div>
<br></div><div>?</div></div></div></blockquote><div><br></div><div style>Yeah, that looks good to me.  :)</div><div style><br></div><div style>From the docs, it seems attr(ms_abi) just maps to x86_64_win64cc and x86_stdcallcc depending on the architecture:</div>
<div style><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bsysv_005fabi_007d-attribute-2670">http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bsysv_005fabi_007d-attribute-2670</a></div>
<div style>gcc also appears to support a sysv_abi attribute, which lets you use the sysv CCs when targeting Windows.</div></div></div></div>