diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td --- a/flang/include/flang/Optimizer/Dialect/FIROps.td +++ b/flang/include/flang/Optimizer/Dialect/FIROps.td @@ -1061,7 +1061,7 @@ - shape: emboxing an array may require shape information (an array's lower bounds and extents may not be known until runtime), - slice: an array section can be described with a slice triple, - - lenParams: for emboxing a derived type with LEN type parameters, + - typeparams: for emboxing a derived type with LEN type parameters, - accessMap: unused/experimental. }]; @@ -1069,7 +1069,7 @@ AnyReferenceLike:$memref, Optional:$shape, Optional:$slice, - Variadic:$lenParams, + Variadic:$typeparams, OptionalAttr:$accessMap ); @@ -1085,7 +1085,7 @@ ]; let assemblyFormat = [{ - $memref (`(` $shape^ `)`)? (`[` $slice^ `]`)? (`typeparams` $lenParams^)? + $memref (`(` $shape^ `)`)? (`[` $slice^ `]`)? (`typeparams` $typeparams^)? (`map` $accessMap^)? attr-dict `:` functional-type(operands, results) }]; @@ -1094,8 +1094,8 @@ let extraClassDeclaration = [{ mlir::Value getShape() { return shape(); } mlir::Value getSlice() { return slice(); } - bool hasLenParams() { return !lenParams().empty(); } - unsigned numLenParams() { return lenParams().size(); } + bool hasLenParams() { return !typeparams().empty(); } + unsigned numLenParams() { return typeparams().size(); } }]; } diff --git a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp --- a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp +++ b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp @@ -99,7 +99,7 @@ } auto xbox = rewriter.create( loc, embox.getType(), embox.memref(), shapeOpers, llvm::None, - llvm::None, llvm::None, embox.lenParams()); + llvm::None, llvm::None, embox.typeparams()); LLVM_DEBUG(llvm::dbgs() << "rewriting " << embox << " to " << xbox << '\n'); rewriter.replaceOp(embox, xbox.getOperation()->getResults()); return mlir::success(); @@ -128,7 +128,7 @@ } auto xbox = rewriter.create( loc, embox.getType(), embox.memref(), shapeOpers, shiftOpers, - sliceOpers, subcompOpers, embox.lenParams()); + sliceOpers, subcompOpers, embox.typeparams()); LLVM_DEBUG(llvm::dbgs() << "rewriting " << embox << " to " << xbox << '\n'); rewriter.replaceOp(embox, xbox.getOperation()->getResults()); return mlir::success(); diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp --- a/flang/lib/Optimizer/Dialect/FIROps.cpp +++ b/flang/lib/Optimizer/Dialect/FIROps.cpp @@ -521,7 +521,7 @@ } else { return op.emitOpError("LEN parameters require CHARACTER or derived type"); } - for (auto lp : op.lenParams()) + for (auto lp : op.typeparams()) if (!fir::isa_integer(lp.getType())) return op.emitOpError("LEN parameters must be integral type"); }