[PATCH] [ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objects

Reid Kleckner rnk at google.com
Mon Jan 27 16:12:24 PST 2014


Hi rsmith,

When a non-trivial parameter is present, clang now gathers up all the
parameters that lack inreg and puts them into a packed struct.  MSVC
always aligns each parameter to 4 bytes and no more, so this is a pretty
simple struct to lay out.

On win64, non-trivial records are passed indirectly.  Prior to this
change, clang was incorrectly using byval on win64.

I'm able to self-host a working clang with this change and additional
LLVM patches.

http://llvm-reviews.chandlerc.com/D2636

Files:
  include/clang/CodeGen/CGFunctionInfo.h
  lib/CodeGen/CGCall.cpp
  lib/CodeGen/CGCall.h
  lib/CodeGen/CGClass.cpp
  lib/CodeGen/CGDecl.cpp
  lib/CodeGen/CodeGenFunction.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/CodeGen/CodeGenTypes.h
  lib/CodeGen/MicrosoftCXXABI.cpp
  lib/CodeGen/TargetInfo.cpp
  test/CodeGenCXX/copy-constructor-elim.cpp
  test/CodeGenCXX/microsoft-abi-arg-order.cpp
  test/CodeGenCXX/microsoft-abi-byval-sret.cpp
  test/CodeGenCXX/microsoft-abi-byval-vararg.cpp
  test/CodeGenCXX/microsoft-abi-exceptions.cpp
  test/CodeGenCXX/microsoft-abi-member-pointers.cpp
  test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
  test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2636.1.patch
Type: text/x-patch
Size: 63475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140127/428c941c/attachment.bin>


More information about the cfe-commits mailing list