[Patch] Mangle C __stdcall and __fastcall in clang

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Oct 9 12:45:30 PDT 2013


On 9 October 2013 14:48, Anton Korobeynikov <anton at korobeynikov.info> wrote:
>> Doesn't mingw need these manglings to match the Windows C ABI?
> Correct, it does need it.

Good catch. The attached patch handles mingw too.

> Another problem, which is much more severe, is that moving mangling in
> clang will force non-clang users to handle the mangling by themselves.

Judging from
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-February/059626.html

that would be an welcome change. The mangling consists of adding how
many bytes are used for arguments. If a frontend can produce a call at
all it has that information.

In any case. This patch changes only clang. Even if we decide to not
change llvm, I think this patch is an improvement as it makes it
possible for us to test that clang produces the desired name for C
code (as we do for C++ already).

> Also, keep in mind, that gcc on linux does support stdcall / fastcall
> calling conventions, but does not mangle the stuff.

That is also handled correctly.

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


More information about the cfe-commits mailing list