<div dir="ltr"><div>Sounds good mostly, but I happen to be in the middle of untangling the mess of CC_Default != CC_C.</div><div><br></div>One thing that should probably work here is if I'm targeting a platform where sysv_abi is equivalent to the default cc, a sysv_abi function should be compatible with a normal function pointer.  Similarly when targeting Windows, an ms_abi function is probably compatible with a normal function pointer.  Please see what gcc does and add tests that show that we match it.<div>
<br></div><div>Hm, now I worry if we have a bug in LLVM.  LLVM will replace calls with the wrong cc with unreachable, I think, and it may not know that x86_64_sysv_cc is compatible with ccc on non-Windows OSs.<br><div><br>
</div><div>Also, what does ms_abi do on x86_32?  Is it stdcall or cdecl?  Add a test for i686.</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 24, 2013 at 10:50 PM, Charles Davis <span dir="ltr"><<a href="mailto:cdavis5x@gmail.com" target="_blank">cdavis5x@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div class="h5"><div>On Jul 12, 2013, at 5:48 AM, Reid Kleckner wrote:</div>
<br><blockquote type="cite"><div dir="ltr">On Tue, Jun 18, 2013 at 6:25 AM, Benno Rice <span dir="ltr"><<a href="mailto:benno@freebsd.org" target="_blank">benno@freebsd.org</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left: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>On 12/06/2013, at 10:40 PM, Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:</div>
<br></div><blockquote type="cite"><div dir="ltr"><div>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><div><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>
<div>You mean like in my patch here:</div></div></div></div><div><br></div><div><a href="http://llvm-reviews.chandlerc.com/D729" target="_blank">http://llvm-reviews.chandlerc.com/D729</a></div><div><div>
<br></div><div>?</div></div></div></blockquote><div><br></div><div>Yeah, that looks good to me.  :)</div><div><br></div><div>From the docs, it seems attr(ms_abi) just maps to x86_64_win64cc and x86_stdcallcc depending on the architecture:</div>


<div><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bsysv_005fabi_007d-attribute-2670" target="_blank">http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bsysv_005fabi_007d-attribute-2670</a></div>


<div>gcc also appears to support a sysv_abi attribute, which lets you use the sysv CCs when targeting Windows.</div></div></div></div></div>
</blockquote></div><br><div>So what's in the way of this being committed? Is there anything I can do that would accelerate things?</div></div></blockquote><div><br></div><div>Benno, Charles added explicit sysv and win64 CCs to LLVM.  Feel free to update your clang patch based on that and resend. </div>

</div></div></div>
</blockquote></div></div>I can wait no longer...</div><div><br></div><div>I've taken the Clang side of Benno's patch, updated it against my LLVM patch, and rebased it against trunk. I also added the complementary sysv_abi attribute.</div>
<div><br></div><div>OK to commit?</div><div><br></div><div>Chip</div><div><br></div></div><br><div style="word-wrap:break-word"></div><br></blockquote></div><br></div>