forked from OSchip/llvm-project
Only trigger the initialize-an-array-via-elementwise-copy/move code
generation when we're dealing with an implicitly-defined copy or move constructor. And, actually set the implicitly-defined bit for implicitly-defined constructors and destructors. Should fix self-host. llvm-svn: 140334
This commit is contained in:
parent
0e4fcb8e3b
commit
eb4089ad01
|
@ -573,7 +573,8 @@ static void EmitMemberInitializer(CodeGenFunction &CGF,
|
|||
llvm::Value *ArrayIndexVar = 0;
|
||||
const ConstantArrayType *Array
|
||||
= CGF.getContext().getAsConstantArrayType(FieldType);
|
||||
if (Array && Constructor->isCopyOrMoveConstructor()) {
|
||||
if (Array && Constructor->isImplicitlyDefined() &&
|
||||
Constructor->isCopyOrMoveConstructor()) {
|
||||
llvm::Type *SizeTy
|
||||
= CGF.ConvertType(CGF.getContext().getSizeType());
|
||||
|
||||
|
|
|
@ -6963,7 +6963,7 @@ void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation,
|
|||
|
||||
SourceLocation Loc = Destructor->getLocation();
|
||||
Destructor->setBody(new (Context) CompoundStmt(Context, 0, 0, Loc, Loc));
|
||||
|
||||
Destructor->setImplicitlyDefined(true);
|
||||
Destructor->setUsed();
|
||||
MarkVTableUsed(CurrentLocation, ClassDecl);
|
||||
|
||||
|
@ -8301,10 +8301,10 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
|
|||
MultiStmtArg(*this, 0, 0),
|
||||
/*isStmtExpr=*/false)
|
||||
.takeAs<Stmt>());
|
||||
CopyConstructor->setImplicitlyDefined(true);
|
||||
}
|
||||
|
||||
CopyConstructor->setUsed();
|
||||
|
||||
if (ASTMutationListener *L = getASTMutationListener()) {
|
||||
L->CompletedImplicitDefinition(CopyConstructor);
|
||||
}
|
||||
|
@ -8464,6 +8464,7 @@ void Sema::DefineImplicitMoveConstructor(SourceLocation CurrentLocation,
|
|||
MultiStmtArg(*this, 0, 0),
|
||||
/*isStmtExpr=*/false)
|
||||
.takeAs<Stmt>());
|
||||
MoveConstructor->setImplicitlyDefined(true);
|
||||
}
|
||||
|
||||
MoveConstructor->setUsed();
|
||||
|
|
Loading…
Reference in New Issue