зеркало из https://github.com/microsoft/clang-1.git
Do not add "byval" attribute to records with non-trivial copy constructors
and destructors in the DefaultABIInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143601 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
25270b6e6a
Коммит
90306934bc
lib/CodeGen
|
@ -339,8 +339,14 @@ llvm::Value *DefaultABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
|
|||
}
|
||||
|
||||
ABIArgInfo DefaultABIInfo::classifyArgumentType(QualType Ty) const {
|
||||
if (isAggregateTypeForABI(Ty))
|
||||
if (isAggregateTypeForABI(Ty)) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
// Treat an enum type as its underlying type.
|
||||
if (const EnumType *EnumTy = Ty->getAs<EnumType>())
|
||||
|
|
Загрузка…
Ссылка в новой задаче