From: Akira Hatanaka Date: Mon, 1 Aug 2011 18:09:58 +0000 (+0000) Subject: Pass records with non-trivial destructors or constructors indirectly. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=511949bf7ea721556ea3eb2777fc1e36e6c3e243;p=clang Pass records with non-trivial destructors or constructors indirectly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136630 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index ea0cec3d91..3866c2b2e5 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -2934,6 +2934,11 @@ ABIArgInfo MipsABIInfo::classifyArgumentType(QualType Ty) const { 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); }