@@ -31,7 +31,9 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
3131 AggValueSlot ensureSlot (mlir::Location loc, QualType t) {
3232 if (!dest.isIgnored ())
3333 return dest;
34- llvm_unreachable (" Slot for ignored address NTI" );
34+
35+ cgf.cgm .errorNYI (loc, " Slot for ignored address" );
36+ return dest;
3537 }
3638
3739public:
@@ -89,7 +91,8 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
8991 cgf.getContext ().getAsArrayType (arrayQTy)->getElementType ();
9092
9193 if (elementType.isDestructedType ()) {
92- llvm_unreachable (" dtorKind NYI" );
94+ cgf.cgm .errorNYI (loc, " dtorKind NYI" );
95+ return ;
9396 }
9497
9598 const QualType elementPtrType = cgf.getContext ().getPointerType (elementType);
@@ -123,8 +126,7 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
123126 // Advance to the next element.
124127 if (i > 0 ) {
125128 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);
128130 }
129131
130132 const Address address = Address (element, cirElementType, elementAlign);
@@ -152,8 +154,9 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
152154
153155 // Allocate the temporary variable
154156 // 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 );
157160 LValue tmpLV = LValue::makeAddr (tmpAddr, elementPtrType);
158161 cgf.emitStoreThroughLValue (RValue::get (element), tmpLV);
159162
@@ -173,8 +176,8 @@ void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
173176
174177 // Advance pointer and store them to temporary variable
175178 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);
178181 cgf.emitStoreThroughLValue (RValue::get (nextElement), tmpLV);
179182 }
180183 }
@@ -223,7 +226,7 @@ void AggExprEmitter::emitNullInitializationToLValue(mlir::Location loc,
223226
224227 if (cgf.hasScalarEvaluationKind (type)) {
225228 // 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);
227230 if (lv.isSimple ()) {
228231 cgf.emitStoreOfScalar (null, lv, /* isInitialization */ true );
229232 return ;
0 commit comments