forked from OSchip/llvm-project
Do not return records with non trivial destructors or copy constructors in
registers. llvm-svn: 150035
This commit is contained in:
parent
94a9a39ec4
commit
c07c4655f1
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue