[cfe-commits] [PATCH] Supporting thiscall compatibility with MSVC

Aaron Ballman aaron at aaronballman.com
Wed Feb 15 18:13:51 PST 2012


This is a patch for bug 10645, which adds ABI support for MSVC's
thiscall calling convention.  Though Microsoft doesn't document this,
the observed behavior is that *all* byval struct returns for thiscall
methods are passed through the hidden pointer in EAX, and
callee-cleaned.  This happens even for small structures which would
normally be returned by EAX or EAX/EDX.

There are two parts to this -- one in llvm's x86 calling convention
tablegen (so that the hidden parameter is not passed in ecx), and the
other is in clang (so that all byval structure return types for
thiscall are returned by hidden pointer when in MS mode).

I've got a few questions though:

Should I have the tablegen only change for MS compatibility?  If so,
I'm not certain of how to do that from the td file.

I'm not certain what the testcase should look like and where it should
live (llvm or clang or both?), or is none needed for this?

Thanks!

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msvc thiscall clang.patch
Type: application/octet-stream
Size: 3633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120215/e183bd3f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msvc thiscall llvm.patch
Type: application/octet-stream
Size: 522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120215/e183bd3f/attachment-0001.obj>


More information about the cfe-commits mailing list