summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-06-29 07:04:55 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-06-29 07:04:55 +0000
commit4774b7e45665e9b0a411ff19db073472a5c7bd70 (patch)
tree8d82350c579f26a28364c34cd85ad29981cf7607 /clang/lib/CodeGen/TargetInfo.cpp
parent4c0dfcec7eb743bb356bd3815d76a6d519ebad3d (diff)
downloadbcm5719-llvm-4774b7e45665e9b0a411ff19db073472a5c7bd70.tar.gz
bcm5719-llvm-4774b7e45665e9b0a411ff19db073472a5c7bd70.zip
We don't pass classes with a copy-constructor or destructor byval, so the address takes up an integer register (if one is available). Make sure the x86-64 ABI implementation takes that into account properly.
The fixed implementation is compatible with the implementation both gcc and llvm-gcc use. rdar://9686430 . (This is the issue that was reported in the thread "[LLVMdev] Segfault calling LLVM libs from a clang-compiled executable".) llvm-svn: 134059
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 47a764bbc00..f65fc185ba4 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -1765,6 +1765,8 @@ ABIArgInfo X86_64ABIInfo::classifyArgumentType(QualType Ty, unsigned &neededInt,
// COMPLEX_X87, it is passed in memory.
case X87:
case ComplexX87:
+ if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
+ ++neededInt;
return getIndirectResult(Ty);
case SSEUp:
OpenPOWER on IntegriCloud