@@ -53,8 +53,8 @@ void genCharacterCopy(mlir::Value src, mlir::Value srcLen, mlir::Value dst,
5353 fir::StoreOp::create (builder, loc, load, dst);
5454 return ;
5555 }
56- auto zero = builder. template create < mlir::arith::ConstantIndexOp>( loc, 0 );
57- auto one = builder. template create < mlir::arith::ConstantIndexOp>( loc, 1 );
56+ auto zero = mlir::arith::ConstantIndexOp::create (builder, loc, 0 );
57+ auto one = mlir::arith::ConstantIndexOp::create (builder, loc, 1 );
5858 auto toArrayTy = [&](fir::CharacterType ty) {
5959 return fir::ReferenceType::get (fir::SequenceType::get (
6060 fir::SequenceType::ShapeRef{fir::SequenceType::getUnknownExtent ()},
@@ -68,8 +68,8 @@ void genCharacterCopy(mlir::Value src, mlir::Value srcLen, mlir::Value dst,
6868 return fir::ReferenceType::get (toEleTy (ty));
6969 };
7070 if (!srcLen && !dstLen && srcTy.getLen () >= dstTy.getLen ()) {
71- auto upper = builder. template create <mlir::arith::ConstantIndexOp>(
72- loc, dstTy.getLen () - 1 );
71+ auto upper =
72+ mlir::arith::ConstantIndexOp::create (builder, loc, dstTy.getLen () - 1 );
7373 auto loop = fir::DoLoopOp::create (builder, loc, zero, upper, one);
7474 auto insPt = builder.saveInsertionPoint ();
7575 builder.setInsertionPointToStart (loop.getBody ());
@@ -92,26 +92,26 @@ void genCharacterCopy(mlir::Value src, mlir::Value srcLen, mlir::Value dst,
9292 return ;
9393 }
9494 auto minusOne = [&](mlir::Value v) -> mlir::Value {
95- return builder.template create <mlir::arith::SubIOp>(
96- loc, fir::ConvertOp::create (builder, loc, one.getType (), v), one);
95+ return mlir::arith::SubIOp::create (
96+ builder, loc, fir::ConvertOp::create (builder, loc, one.getType (), v),
97+ one);
9798 };
9899 mlir::Value len = dstLen ? minusOne (dstLen)
99- : builder
100- .template create <mlir::arith::ConstantIndexOp>(
101- loc, dstTy.getLen () - 1 )
100+ : mlir::arith::ConstantIndexOp::create (
101+ builder, loc, dstTy.getLen () - 1 )
102102 .getResult ();
103103 auto loop = fir::DoLoopOp::create (builder, loc, zero, len, one);
104104 auto insPt = builder.saveInsertionPoint ();
105105 builder.setInsertionPointToStart (loop.getBody ());
106106 mlir::Value slen =
107- srcLen ? fir::ConvertOp::create (builder, loc, one. getType (), srcLen)
108- . getResult ( )
109- : builder
110- . template create < mlir::arith::ConstantIndexOp>(
111- loc, srcTy. getLen ())
112- . getResult ();
113- auto cond = builder. template create < mlir::arith::CmpIOp>(
114- loc, mlir::arith::CmpIPredicate::slt, loop.getInductionVar (), slen);
107+ srcLen
108+ ? fir::ConvertOp::create (builder, loc, one. getType (), srcLen )
109+ . getResult ()
110+ : mlir::arith::ConstantIndexOp::create (builder, loc, srcTy. getLen ())
111+ . getResult ();
112+ auto cond =
113+ mlir::arith::CmpIOp::create (builder, loc, mlir::arith::CmpIPredicate::slt,
114+ loop.getInductionVar (), slen);
115115 auto ifOp = fir::IfOp::create (builder, loc, cond, /* withElse=*/ true );
116116 builder.setInsertionPointToStart (&ifOp.getThenRegion ().front ());
117117 auto csrcTy = toArrayTy (srcTy);
@@ -189,7 +189,7 @@ originateIndices(mlir::Location loc, B &builder, mlir::Type memTy,
189189 auto ty = fir::dyn_cast_ptrOrBoxEleTy (memTy);
190190 assert (ty && mlir::isa<fir::SequenceType>(ty));
191191 auto seqTy = mlir::cast<fir::SequenceType>(ty);
192- auto one = builder. template create < mlir::arith::ConstantIndexOp>( loc, 1 );
192+ auto one = mlir::arith::ConstantIndexOp::create (builder, loc, 1 );
193193 const auto dimension = seqTy.getDimension ();
194194 if (shapeVal) {
195195 assert (dimension == mlir::cast<fir::ShapeOp>(shapeVal.getDefiningOp ())
@@ -200,7 +200,7 @@ originateIndices(mlir::Location loc, B &builder, mlir::Type memTy,
200200 if (i.index () < dimension) {
201201 assert (fir::isa_integer (i.value ().getType ()));
202202 result.push_back (
203- builder. template create < mlir::arith::AddIOp>( loc, i.value (), one));
203+ mlir::arith::AddIOp::create (builder, loc, i.value (), one));
204204 } else {
205205 result.push_back (i.value ());
206206 }
@@ -211,8 +211,8 @@ originateIndices(mlir::Location loc, B &builder, mlir::Type memTy,
211211 unsigned origOff = 0 ;
212212 for (auto i : llvm::enumerate (indices)) {
213213 if (i.index () < dimension)
214- result.push_back (builder. template create < mlir::arith::AddIOp>(
215- loc, i. value (), origins[origOff++]));
214+ result.push_back (mlir::arith::AddIOp::create (builder, loc, i. value (),
215+ origins[origOff++]));
216216 else
217217 result.push_back (i.value ());
218218 }
0 commit comments