<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 15, 2013 at 5:57 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<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 class="im">> Oh, I see, mingw does the opposite.  :(  I was hoping it would be the same,<br>

> but I guess it makes sense because we don't mangle calling conventions under<br>
> Itanium.  We might want actually want to add a mangling, seeing as you can<br>
> overload based on CC in clang.<br>
<br>
</div>Well, we have to follow what gcc does on mingw.</blockquote><div><br></div><div>True.</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 class="im">
> I think John would tell you to sink this logic into the MangleContext<br>
> subclasses.<br>
<br>
</div>That would require exposing getStdOrFastCallMangling to the<br>
subclasses. I doesn't look worth it.</blockquote><div><br></div><div>I don't feel strongly.</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 class="im">
> +  // Variadic functions do not receive @0 suffix.<br>
> +  const FunctionDecl *FD = cast<FunctionDecl>(D);<br>
> +  const FunctionType *FT = FD->getType()->castAs<FunctionType>();<br>
> +  const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FT);<br>
> +  if (Proto && Proto->isVariadic())<br>
> +    return;<br>
> +  if (!Proto) {<br>
> +    Out << '0';<br>
> +    return;<br>
> +  }<br>
><br>
> Can this be tested?  I thought we removed fastcall and cdecl from variadic<br>
> functions, and I have no idea what happens for K&R functions.<br>
<br>
</div>True. I started working on the patch while they were still allowed and<br>
forgot to simplify it after that. The new attached patch uses an<br>
assert.<br></blockquote><div><br></div><div>Looks good. </div></div></div></div>