forked from OSchip/llvm-project
Implement a few more cases for copy constructor synthesis.
llvm-svn: 88971
This commit is contained in:
parent
1b8fe5b716
commit
c2ef215bda
|
@ -1381,8 +1381,16 @@ CodeGenFunction::SynthesizeCXXCopyConstructor(const CXXConstructorDecl *Ctor,
|
|||
// Do a built-in assignment of scalar data members.
|
||||
LValue LHS = EmitLValueForField(LoadOfThis, *Field, false, 0);
|
||||
LValue RHS = EmitLValueForField(LoadOfSrc, *Field, false, 0);
|
||||
RValue RVRHS = EmitLoadOfLValue(RHS, FieldType);
|
||||
EmitStoreThroughLValue(RVRHS, LHS, FieldType);
|
||||
if (!hasAggregateLLVMType(Field->getType())) {
|
||||
RValue RVRHS = EmitLoadOfLValue(RHS, Field->getType());
|
||||
EmitStoreThroughLValue(RVRHS, LHS, Field->getType());
|
||||
} else if (Field->getType()->isAnyComplexType()) {
|
||||
ComplexPairTy Pair = LoadComplexFromAddr(RHS.getAddress(),
|
||||
RHS.isVolatileQualified());
|
||||
StoreComplexToAddr(Pair, LHS.getAddress(), LHS.isVolatileQualified());
|
||||
} else {
|
||||
EmitAggregateCopy(LHS.getAddress(), RHS.getAddress(), Field->getType());
|
||||
}
|
||||
}
|
||||
FinishFunction();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ struct X : M, N, P { // ...
|
|||
const char *name;
|
||||
unsigned bf1 : 8;
|
||||
unsigned bf2 : 16;
|
||||
int arr[2];
|
||||
_Complex float complex;
|
||||
|
||||
union {
|
||||
int au_i1;
|
||||
|
|
Loading…
Reference in New Issue