@@ -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,8 @@ 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" , /* insertIntoFnEntryBlock= */ false );
157
159
LValue tmpLV = LValue::makeAddr (tmpAddr, elementPtrType);
158
160
cgf.emitStoreThroughLValue (RValue::get (element), tmpLV);
159
161
@@ -173,8 +175,8 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
173
175
174
176
// Advance pointer and store them to temporary variable
175
177
one = builder.getConstantInt (loc, cgf.PtrDiffTy , 1 );
176
- auto nextElement = builder.create <cir::PtrStrideOp> (
177
- loc, cirElementPtrType, currentElement, one);
178
+ cir::PtrStrideOp nextElement = builder.createPtrStride (
179
+ loc, currentElement, one);
178
180
cgf.emitStoreThroughLValue (RValue::get (nextElement), tmpLV);
179
181
}
180
182
}
@@ -223,7 +225,7 @@ void AggExprEmitter::emitNullInitializationToLValue(mlir::Location loc,
223
225
224
226
if (cgf.hasScalarEvaluationKind (type)) {
225
227
// For non-aggregates, we can store the appropriate null constant.
226
- auto null = cgf.cgm .emitNullConstant (type, loc);
228
+ mlir::Value null = cgf.cgm .emitNullConstant (type, loc);
227
229
if (lv.isSimple ()) {
228
230
cgf.emitStoreOfScalar (null, lv, /* isInitialization */ true );
229
231
return ;
0 commit comments