Do not return records with non trivial destructors or copy constructors in

registers.

llvm-svn: 150035
This commit is contained in:
Akira Hatanaka 2012-02-08 01:31:22 +00:00
parent 94a9a39ec4
commit c07c4655f1
2 changed files with 18 additions and 1 deletions

View File

@ -3215,7 +3215,7 @@ ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
if (RetTy->isAnyComplexType())
return ABIArgInfo::getDirect();
if (!IsO32)
if (!IsO32 && !isRecordWithNonTrivialDestructorOrCopyConstructor(RetTy))
return ABIArgInfo::getDirect(returnAggregateInRegs(RetTy, Size));
}

View File

@ -0,0 +1,17 @@
// RUN: %clang -target mips64el-unknown-linux -ccc-clang-archs mips64el -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s
class B {
public:
virtual ~B() {}
};
class D : public B {
};
extern D gd0;
// CHECK: _Z4foo1v(%class.D* noalias nocapture sret
D foo1(void) {
return gd0;
}