[Patch] Mangle C __stdcall and __fastcall in clang

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Oct 15 15:00:25 PDT 2013


> 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 at Foo@@QAGXXZ, which demangles to (public: void __stdcall
> Foo::foo(void)), which already includes the calling convention anyway.
>
> struct Foo {
>   void __stdcall foo();
> };
> void Foo::foo() {}
>
> Feel free to commit with that fixed.

The code was already handling that, but looking at it I found that it
would get confused with corner cases like

extern "C" void __stdcall operator++(Foo &x).

To be fair, it look like gcc and cl get confused too. I have update
the patch. Would you mind one final review? Thanks.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 15109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131015/e8ca2ef5/attachment.obj>


More information about the cfe-commits mailing list