@@ -441,12 +441,11 @@ static mlir::Value emitArraySubscriptPtr(CIRGenFunction &cgf,
441
441
mlir::Location beginLoc,
442
442
mlir::Location endLoc, mlir::Value ptr,
443
443
mlir::Type eltTy, mlir::Value idx,
444
- bool inbounds, bool shouldDecay) {
444
+ bool shouldDecay) {
445
445
CIRGenModule &cgm = cgf.getCIRGenModule ();
446
446
// TODO(cir): LLVM codegen emits in bound gep check here, is there anything
447
447
// that would enhance tracking this later in CIR?
448
- if (inbounds)
449
- assert (!cir::MissingFeatures::emitCheckedInBoundsGEP () && " NYI" );
448
+ assert (!cir::MissingFeatures::emitCheckedInBoundsGEP ());
450
449
return cgm.getBuilder ().getArrayElement (beginLoc, endLoc, ptr, eltTy, idx,
451
450
shouldDecay);
452
451
}
@@ -455,8 +454,7 @@ static Address emitArraySubscriptPtr(CIRGenFunction &cgf,
455
454
mlir::Location beginLoc,
456
455
mlir::Location endLoc, Address addr,
457
456
QualType eltType, mlir::Value idx,
458
- bool inbounds, mlir::Location loc,
459
- bool shouldDecay) {
457
+ mlir::Location loc, bool shouldDecay) {
460
458
461
459
// Determine the element size of the statically-sized base. This is
462
460
// the thing that the indices are expressed in terms of.
@@ -475,8 +473,7 @@ static Address emitArraySubscriptPtr(CIRGenFunction &cgf,
475
473
if (!index) {
476
474
assert (!cir::MissingFeatures::preservedAccessIndexRegion ());
477
475
eltPtr = emitArraySubscriptPtr (cgf, beginLoc, endLoc, addr.getPointer (),
478
- addr.getElementType (), idx, inbounds,
479
- shouldDecay);
476
+ addr.getElementType (), idx, shouldDecay);
480
477
} else {
481
478
cgf.cgm .errorNYI (" emitArraySubscriptExpr: Non Constant Index" );
482
479
}
@@ -524,8 +521,7 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) {
524
521
// Propagate the alignment from the array itself to the result.
525
522
const Address addr = emitArraySubscriptPtr (
526
523
*this , cgm.getLoc (array->getBeginLoc ()), cgm.getLoc (array->getEndLoc ()),
527
- arrayLV.getAddress (), e->getType (), idx,
528
- !getLangOpts ().isSignedOverflowDefined (), cgm.getLoc (e->getExprLoc ()),
524
+ arrayLV.getAddress (), e->getType (), idx, cgm.getLoc (e->getExprLoc ()),
529
525
/* shouldDecay=*/ true );
530
526
531
527
return LValue::makeAddr (addr, e->getType ());
0 commit comments