Skip to content

Commit 9d07a29

Browse files
committed
Remove inbounds for now
1 parent 33eff17 commit 9d07a29

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

clang/lib/CIR/CodeGen/CIRGenExpr.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,11 @@ static mlir::Value emitArraySubscriptPtr(CIRGenFunction &cgf,
441441
mlir::Location beginLoc,
442442
mlir::Location endLoc, mlir::Value ptr,
443443
mlir::Type eltTy, mlir::Value idx,
444-
bool inbounds, bool shouldDecay) {
444+
bool shouldDecay) {
445445
CIRGenModule &cgm = cgf.getCIRGenModule();
446446
// TODO(cir): LLVM codegen emits in bound gep check here, is there anything
447447
// that would enhance tracking this later in CIR?
448-
if (inbounds)
449-
assert(!cir::MissingFeatures::emitCheckedInBoundsGEP() && "NYI");
448+
assert(!cir::MissingFeatures::emitCheckedInBoundsGEP());
450449
return cgm.getBuilder().getArrayElement(beginLoc, endLoc, ptr, eltTy, idx,
451450
shouldDecay);
452451
}
@@ -455,8 +454,7 @@ static Address emitArraySubscriptPtr(CIRGenFunction &cgf,
455454
mlir::Location beginLoc,
456455
mlir::Location endLoc, Address addr,
457456
QualType eltType, mlir::Value idx,
458-
bool inbounds, mlir::Location loc,
459-
bool shouldDecay) {
457+
mlir::Location loc, bool shouldDecay) {
460458

461459
// Determine the element size of the statically-sized base. This is
462460
// the thing that the indices are expressed in terms of.
@@ -475,8 +473,7 @@ static Address emitArraySubscriptPtr(CIRGenFunction &cgf,
475473
if (!index) {
476474
assert(!cir::MissingFeatures::preservedAccessIndexRegion());
477475
eltPtr = emitArraySubscriptPtr(cgf, beginLoc, endLoc, addr.getPointer(),
478-
addr.getElementType(), idx, inbounds,
479-
shouldDecay);
476+
addr.getElementType(), idx, shouldDecay);
480477
} else {
481478
cgf.cgm.errorNYI("emitArraySubscriptExpr: Non Constant Index");
482479
}
@@ -524,8 +521,7 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) {
524521
// Propagate the alignment from the array itself to the result.
525522
const Address addr = emitArraySubscriptPtr(
526523
*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()),
529525
/*shouldDecay=*/true);
530526

531527
return LValue::makeAddr(addr, e->getType());

0 commit comments

Comments
 (0)