Commit Graph

7 Commits

Author SHA1 Message Date
David Blaikie 218b783192 Update Clang tests to handle explicitly typed gep changes in LLVM.
llvm-svn: 230783
2015-02-27 19:18:17 +00:00
Reid Kleckner e39ee21551 MS ABI x64: Pass small objects with dtors but no copy ctors directly
Passing objects directly (in registers or memory) creates a second copy
of the object in the callee.  The callee always destroys its copy, but
we also have to destroy any temporary created in the caller.  In other
words, copy elision of these kinds of objects is impossible.

Objects larger than 8 bytes with non-trivial dtors and trivial copy
ctors are still passed indirectly, and we can still elide copies of
them.

Fixes PR19640.

llvm-svn: 207889
2014-05-03 00:33:28 +00:00
Reid Kleckner ac64060c80 MS ABI x64: Don't destroy arguments twice on x64
We were destroying them in the callee, and then again in the caller.  We
should use an EH-only cleanup and disable it at the point of the call
for win64, even though we don't use inalloca.

llvm-svn: 207733
2014-05-01 03:07:18 +00:00
David Majnemer 970714bcf9 Update clang to account for changes made to LLVM in r203376
llvm-svn: 203377
2014-03-09 07:09:06 +00:00
Reid Kleckner 314ef7bafd [ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objects
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.

Reviewers: rsmith

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

llvm-svn: 200597
2014-02-01 00:04:45 +00:00
Hans Wennborg c9bd88e681 Remove the -cxx-abi command-line flag.
This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples,
Itanium otherwise. It's no longer possible to do weird combinations.

To be able to run a test with a specific ABI without constraining it to a
specific triple, new substitutions are added to lit: %itanium_abi_triple and
%ms_abi_triple can be used to get the current target triple adjusted to the
desired ABI. For example, if the test suite is running with the i686-pc-win32
target, %itanium_abi_triple will expand to i686-pc-mingw32.

Differential Revision: http://llvm-reviews.chandlerc.com/D2545

llvm-svn: 199250
2014-01-14 19:35:09 +00:00
Reid Kleckner 739756c0f9 [ms-cxxabi] Construct and destroy call arguments in the correct order
Summary:
MSVC destroys arguments in the callee from left to right.  Because C++
objects have to be destroyed in the reverse order of construction, Clang
has to construct arguments from right to left and destroy arguments from
left to right.

This patch fixes the ordering by reversing the order of evaluation of
all call arguments under the MS C++ ABI.

Fixes PR18035.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D2275

llvm-svn: 196402
2013-12-04 19:23:12 +00:00