@@ -283,8 +283,7 @@ static mlir::Value emitArraySubscriptPtr(CIRGenFunction &cgf,
283
283
mlir::Location beginLoc,
284
284
mlir::Location endLoc, mlir::Value ptr,
285
285
mlir::Type eltTy, mlir::Value idx,
286
- bool inbounds, bool signedIndices,
287
- bool shouldDecay) {
286
+ bool inbounds, bool shouldDecay) {
288
287
CIRGenModule &cgm = cgf.getCIRGenModule ();
289
288
// TODO(cir): LLVM codegen emits in bound gep check here, is there anything
290
289
// that would enhance tracking this later in CIR?
@@ -294,11 +293,12 @@ static mlir::Value emitArraySubscriptPtr(CIRGenFunction &cgf,
294
293
shouldDecay);
295
294
}
296
295
297
- static Address
298
- emitArraySubscriptPtr (CIRGenFunction &cgf, mlir::Location beginLoc,
299
- mlir::Location endLoc, Address addr, QualType eltType,
300
- mlir::Value idx, bool inbounds, mlir::Location loc,
301
- bool shouldDecay, QualType *arrayType, const Expr *base) {
296
+ static Address emitArraySubscriptPtr (CIRGenFunction &cgf,
297
+ mlir::Location beginLoc,
298
+ mlir::Location endLoc, Address addr,
299
+ QualType eltType, mlir::Value idx,
300
+ bool inbounds, mlir::Location loc,
301
+ bool shouldDecay) {
302
302
303
303
// Determine the element size of the statically-sized base. This is
304
304
// the thing that the indices are expressed in terms of.
@@ -315,9 +315,9 @@ emitArraySubscriptPtr(CIRGenFunction &cgf, mlir::Location beginLoc,
315
315
mlir::Value eltPtr;
316
316
const mlir::IntegerAttr index = getConstantIndexOrNull (idx);
317
317
if (!index) {
318
- eltPtr = emitArraySubscriptPtr (
319
- cgf, beginLoc, endLoc, addr. getPointer (), addr.getElementType (), idx,
320
- inbounds, idx. getType (). isSignlessIntOrIndex (), shouldDecay);
318
+ eltPtr = emitArraySubscriptPtr (cgf, beginLoc, endLoc, addr. getPointer (),
319
+ addr.getElementType (), idx, inbounds ,
320
+ shouldDecay);
321
321
} else {
322
322
cgf.cgm .errorNYI (" emitArraySubscriptExpr: Non Constant Index" );
323
323
}
@@ -363,12 +363,11 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) {
363
363
arrayLV = emitLValue (array);
364
364
365
365
// Propagate the alignment from the array itself to the result.
366
- QualType arrayType = array->getType ();
367
366
const Address addr = emitArraySubscriptPtr (
368
367
*this , cgm.getLoc (array->getBeginLoc ()), cgm.getLoc (array->getEndLoc ()),
369
368
arrayLV.getAddress (), e->getType (), idx,
370
369
!getLangOpts ().isSignedOverflowDefined (), cgm.getLoc (e->getExprLoc ()),
371
- /* shouldDecay=*/ true , &arrayType, e-> getBase () );
370
+ /* shouldDecay=*/ true );
372
371
373
372
return LValue::makeAddr (addr, e->getType ());
374
373
}
0 commit comments