]> granicus.if.org Git - clang/commitdiff
Pass records with non-trivial destructors or constructors indirectly.
authorAkira Hatanaka <ahatanak@gmail.com>
Mon, 1 Aug 2011 18:09:58 +0000 (18:09 +0000)
committerAkira Hatanaka <ahatanak@gmail.com>
Mon, 1 Aug 2011 18:09:58 +0000 (18:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136630 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp

index ea0cec3d91996a01d970d9239a298f9e62760c7d..3866c2b2e503ed4e764031db0da97c2e2cbffd03 100644 (file)
@@ -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);
   }