@@ -31,7 +31,9 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
31
31
AggValueSlot ensureSlot (mlir::Location loc, QualType t) {
32
32
if (!dest.isIgnored ())
33
33
return dest;
34
- llvm_unreachable (" Slot for ignored address NTI" );
34
+
35
+ cgf.cgm .errorNYI (loc, " Slot for ignored address" );
36
+ return dest;
35
37
}
36
38
37
39
public:
@@ -89,7 +91,8 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
89
91
cgf.getContext ().getAsArrayType (arrayQTy)->getElementType ();
90
92
91
93
if (elementType.isDestructedType ()) {
92
- llvm_unreachable (" dtorKind NYI" );
94
+ cgf.cgm .errorNYI (loc, " dtorKind NYI" );
95
+ return ;
93
96
}
94
97
95
98
const QualType elementPtrType = cgf.getContext ().getPointerType (elementType);
@@ -123,8 +126,7 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
123
126
// Advance to the next element.
124
127
if (i > 0 ) {
125
128
one = builder.getConstantInt (loc, cgf.PtrDiffTy , i);
126
- element =
127
- builder.create <cir::PtrStrideOp>(loc, cirElementPtrType, begin, one);
129
+ element = builder.createPtrStride (loc, begin, one);
128
130
}
129
131
130
132
const Address address = Address (element, cirElementType, elementAlign);
@@ -152,8 +154,9 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
152
154
153
155
// Allocate the temporary variable
154
156
// to store the pointer to first unitialized element
155
- auto tmpAddr = cgf.createTempAlloca (
156
- cirElementPtrType, cgf.getPointerAlign (), loc, " arrayinit.temp" , false );
157
+ const Address tmpAddr = cgf.createTempAlloca (
158
+ cirElementPtrType, cgf.getPointerAlign (), loc, " arrayinit.temp" ,
159
+ /* insertIntoFnEntryBlock=*/ false );
157
160
LValue tmpLV = LValue::makeAddr (tmpAddr, elementPtrType);
158
161
cgf.emitStoreThroughLValue (RValue::get (element), tmpLV);
159
162
@@ -173,8 +176,8 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
173
176
174
177
// Advance pointer and store them to temporary variable
175
178
one = builder.getConstantInt (loc, cgf.PtrDiffTy , 1 );
176
- auto nextElement = builder. create < cir::PtrStrideOp>(
177
- loc, cirElementPtrType , currentElement, one);
179
+ cir::PtrStrideOp nextElement =
180
+ builder. createPtrStride ( loc, currentElement, one);
178
181
cgf.emitStoreThroughLValue (RValue::get (nextElement), tmpLV);
179
182
}
180
183
}
@@ -223,7 +226,7 @@ void AggExprEmitter::emitNullInitializationToLValue(mlir::Location loc,
223
226
224
227
if (cgf.hasScalarEvaluationKind (type)) {
225
228
// For non-aggregates, we can store the appropriate null constant.
226
- auto null = cgf.cgm .emitNullConstant (type, loc);
229
+ mlir::Value null = cgf.cgm .emitNullConstant (type, loc);
227
230
if (lv.isSimple ()) {
228
231
cgf.emitStoreOfScalar (null, lv, /* isInitialization */ true );
229
232
return ;
0 commit comments