<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 15, 2013 at 12:58 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">> shouldMangleDeclNameImpl can be shouldMangleCXXName, following the same<br>

> logic as mangleName.<br>
<br>
</div>Done.<br>
<div class="im"><br>
> This AttributedType handling isn't necessary, use T->castAs<FunctionType>()<br>
> instead of cast<>() to look through the type sugar.<br>
<br>
</div>This is awesome. Done.<br>
<div class="im"><br>
> +  return mangleCXXName(D, Out);<br>
><br>
> We shouldn't apply the stdcall or fastcall manglings to C++ symbols.  You<br>
> should check if we should mangle this as a C++ name first, and after that<br>
> see if we need to apply C manglings.<br>
<br>
</div>Thanks. I noticed that we were not quoting the mingw case. I have<br>
fixed the logic and added a c++ testcase.<br></blockquote><div><br></div><div>Almost right.  Don't try to mangle non-extern C C++ symbols, as in things that return true for shouldMangleCXXName().  This test case gives the symbol ?foo@Foo@@QAGXXZ, which demangles to (public: void __stdcall Foo::foo(void)), which already includes the calling convention anyway.</div>
<div><br></div><div><div>struct Foo {</div><div>  void __stdcall foo();</div><div>};</div><div>void Foo::foo() {}</div></div><div><br></div><div>Feel free to commit with that fixed.</div><div><br></div><div>At this point it's not clear to me that you need the StdOrFastCC enum anymore, but I don't feel strongly.</div>
</div></div></div>