diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp index 1bc981516e226..3bbc32f23bcfa 100644 --- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp +++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp @@ -2239,17 +2239,18 @@ struct XReboxOpConversion : public EmboxCommonConversion { getSubcomponentIndices(rebox, rebox.getBox(), operands, fieldIndices); if (!rebox.getSubstr().empty()) substringOffset = operands[rebox.getSubstrOperandIndex()]; - base = genBoxOffsetGep(rewriter, loc, base, llvmBaseObjectType, zero, - /*cstInteriorIndices=*/std::nullopt, fieldIndices, - substringOffset); + base = + genBoxOffsetGep(rewriter, loc, base, llvmBaseObjectType, zero, + /*cstInteriorIndices=*/llvm::ArrayRef(), + fieldIndices, substringOffset); } if (rebox.getSlice().empty()) // The array section is of the form array[%component][substring], keep // the input array extents and strides. return finalizeRebox(rebox, adaptor, destBoxTy, dest, base, - /*lbounds*/ std::nullopt, inputExtents, inputStrides, - rewriter); + /*lbounds*/ llvm::ArrayRef(), + inputExtents, inputStrides, rewriter); // The slice is of the form array(i:j:k)[%component]. Compute new extents // and strides. @@ -2297,8 +2298,8 @@ struct XReboxOpConversion : public EmboxCommonConversion { } } return finalizeRebox(rebox, adaptor, destBoxTy, dest, base, - /*lbounds*/ std::nullopt, slicedExtents, slicedStrides, - rewriter); + /*lbounds*/ llvm::ArrayRef(), + slicedExtents, slicedStrides, rewriter); } /// Apply a new shape to the data described by a box given the base address, @@ -3396,7 +3397,8 @@ static void genBrOp(A caseOp, mlir::Block *dest, std::optional destOps, if (destOps) rewriter.replaceOpWithNewOp(caseOp, *destOps, dest); else - rewriter.replaceOpWithNewOp(caseOp, std::nullopt, dest); + rewriter.replaceOpWithNewOp( + caseOp, llvm::ArrayRef(), dest); } static void genCaseLadderStep(mlir::Location loc, mlir::Value cmp, diff --git a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp index d09d7d397e8b7..eca2c7f7c942f 100644 --- a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp +++ b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp @@ -107,9 +107,11 @@ class EmboxConversion : public mlir::OpRewritePattern { shapeOpers.push_back(extVal); } auto xbox = rewriter.create( - loc, embox.getType(), embox.getMemref(), shapeOpers, std::nullopt, - std::nullopt, std::nullopt, std::nullopt, embox.getTypeparams(), - embox.getSourceBox(), embox.getAllocatorIdxAttr()); + loc, embox.getType(), embox.getMemref(), shapeOpers, + llvm::ArrayRef(), llvm::ArrayRef(), + llvm::ArrayRef(), llvm::ArrayRef(), + embox.getTypeparams(), embox.getSourceBox(), + embox.getAllocatorIdxAttr()); LLVM_DEBUG(llvm::dbgs() << "rewriting " << embox << " to " << xbox << '\n'); rewriter.replaceOp(embox, xbox.getOperation()->getResults()); return mlir::success();