@@ -86,19 +86,17 @@ static void emitMemberInitializer(CIRGenFunction &cgf,
86
86
87
87
mlir::Value thisPtr = cgf.loadCXXThis ();
88
88
QualType recordTy = cgf.getContext ().getTypeDeclType (classDecl);
89
- LValue lhs;
90
89
91
90
// If a base constructor is being emitted, create an LValue that has the
92
91
// non-virtual alignment.
93
- if (cgf.curGD .getCtorType () == Ctor_Base)
94
- lhs = cgf.makeNaturalAlignPointeeAddrLValue (thisPtr, recordTy);
95
- else
96
- lhs = cgf.makeNaturalAlignAddrLValue (thisPtr, recordTy);
92
+ LValue lhs = (cgf.curGD .getCtorType () == Ctor_Base) ?
93
+ cgf.makeNaturalAlignPointeeAddrLValue (thisPtr, recordTy) :
94
+ cgf.makeNaturalAlignAddrLValue (thisPtr, recordTy);
97
95
98
96
emitLValueForAnyFieldInitialization (cgf, memberInit, lhs);
99
97
100
98
// Special case: If we are in a copy or move constructor, and we are copying
101
- // an array off PODs or classes with tirival copy constructors, ignore the AST
99
+ // an array off PODs or classes with trivial copy constructors, ignore the AST
102
100
// and perform the copy we know is equivalent.
103
101
// FIXME: This is hacky at best... if we had a bit more explicit information
104
102
// in the AST, we could generalize it more easily.
@@ -205,12 +203,11 @@ void CIRGenFunction::emitInitializerForField(FieldDecl *field, LValue lhs,
205
203
QualType fieldType = field->getType ();
206
204
switch (getEvaluationKind (fieldType)) {
207
205
case cir::TEK_Scalar:
208
- if (lhs.isSimple ()) {
206
+ if (lhs.isSimple ())
209
207
emitExprAsInit (init, field, lhs, false );
210
- } else {
208
+ else
211
209
cgm.errorNYI (field->getSourceRange (),
212
210
" emitInitializerForField: non-simple scalar" );
213
- }
214
211
break ;
215
212
case cir::TEK_Complex:
216
213
cgm.errorNYI (field->getSourceRange (), " emitInitializerForField: complex" );
0 commit comments