Pass records with non-trivial destructors or constructors indirectly.

llvm-svn: 136630
This commit is contained in:
Akira Hatanaka 2011-08-01 18:09:58 +00:00
parent af8e96c185
commit df425dbf04
1 changed files with 5 additions and 0 deletions

View 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);
}