]> granicus.if.org Git - clang/commit
MS ABI x64: Pass small objects with dtors but no copy ctors directly
authorReid Kleckner <reid@kleckner.net>
Sat, 3 May 2014 00:33:28 +0000 (00:33 +0000)
committerReid Kleckner <reid@kleckner.net>
Sat, 3 May 2014 00:33:28 +0000 (00:33 +0000)
commit3753e68d0a785dc92ee7317585d521e502f65a95
tree5a7bfa1ed09cec8b67ed35497a320714e5e3db4e
parent011ceaf955ef9b050e8be66edc8ac28485066b59
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207889 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
test/CodeGenCXX/microsoft-abi-arg-order.cpp
test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp