[cfe-commits] r136630 - /cfe/trunk/lib/CodeGen/TargetInfo.cpp
Akira Hatanaka
ahatanak at gmail.com
Mon Aug 1 11:09:58 PDT 2011
Author: ahatanak
Date: Mon Aug 1 13:09:58 2011
New Revision: 136630
URL: http://llvm.org/viewvc/llvm-project?rev=136630&view=rev
Log:
Pass records with non-trivial destructors or constructors indirectly.
Modified:
cfe/trunk/lib/CodeGen/TargetInfo.cpp
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=136630&r1=136629&r2=136630&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Aug 1 13:09:58 2011
@@ -2934,6 +2934,11 @@
if (getContext().getTypeSize(Ty) == 0)
return ABIArgInfo::getIgnore();
+ // Records with non trivial destructors/constructors should not be passed
+ // by value.
+ if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
+ return ABIArgInfo::getIndirect(0, /*ByVal=*/false);
+
return ABIArgInfo::getIndirect(0);
}
More information about the cfe-commits
mailing list