@@ -28,7 +28,7 @@ fir::factory::Counter::Counter(mlir::Location loc, fir::FirOpBuilder &builder,
28
28
one = builder.createIntegerConstant (loc, type, 1 );
29
29
if (canCountThroughLoops) {
30
30
index = builder.createTemporary (loc, type);
31
- builder. create < fir::StoreOp>( loc, initialValue, index);
31
+ fir::StoreOp::create (builder, loc, initialValue, index);
32
32
} else {
33
33
index = initialValue;
34
34
}
@@ -38,21 +38,21 @@ mlir::Value
38
38
fir::factory::Counter::getAndIncrementIndex (mlir::Location loc,
39
39
fir::FirOpBuilder &builder) {
40
40
if (canCountThroughLoops) {
41
- mlir::Value indexValue = builder. create < fir::LoadOp>( loc, index);
41
+ mlir::Value indexValue = fir::LoadOp::create (builder, loc, index);
42
42
mlir::Value newValue =
43
- builder. create < mlir::arith::AddIOp>( loc, indexValue, one);
44
- builder. create < fir::StoreOp>( loc, newValue, index);
43
+ mlir::arith::AddIOp::create (builder, loc, indexValue, one);
44
+ fir::StoreOp::create (builder, loc, newValue, index);
45
45
return indexValue;
46
46
}
47
47
mlir::Value indexValue = index;
48
- index = builder. create < mlir::arith::AddIOp>( loc, indexValue, one);
48
+ index = mlir::arith::AddIOp::create (builder, loc, indexValue, one);
49
49
return indexValue;
50
50
}
51
51
52
52
void fir::factory::Counter::reset (mlir::Location loc,
53
53
fir::FirOpBuilder &builder) {
54
54
if (canCountThroughLoops)
55
- builder. create < fir::StoreOp>( loc, initialValue, index);
55
+ fir::StoreOp::create (builder, loc, initialValue, index);
56
56
else
57
57
index = initialValue;
58
58
}
@@ -103,7 +103,7 @@ void fir::factory::HomogeneousScalarStack::pushValue(mlir::Location loc,
103
103
// below should not get hit but is added as a remainder/safety.
104
104
if (!entity.hasIntrinsicType ())
105
105
TODO (loc, " creating inlined temporary stack for derived types" );
106
- builder. create < hlfir::AssignOp>( loc, value, tempElement);
106
+ hlfir::AssignOp::create (builder, loc, value, tempElement);
107
107
}
108
108
109
109
void fir::factory::HomogeneousScalarStack::resetFetchPosition (
@@ -125,14 +125,14 @@ void fir::factory::HomogeneousScalarStack::destroy(mlir::Location loc,
125
125
if (allocateOnHeap) {
126
126
auto declare = temp.getDefiningOp <hlfir::DeclareOp>();
127
127
assert (declare && " temp must have been declared" );
128
- builder. create < fir::FreeMemOp>( loc, declare.getMemref ());
128
+ fir::FreeMemOp::create (builder, loc, declare.getMemref ());
129
129
}
130
130
}
131
131
132
132
hlfir::Entity fir::factory::HomogeneousScalarStack::moveStackAsArrayExpr (
133
133
mlir::Location loc, fir::FirOpBuilder &builder) {
134
134
mlir::Value mustFree = builder.createBool (loc, allocateOnHeap);
135
- auto hlfirExpr = builder. create < hlfir::AsExprOp>( loc, temp, mustFree);
135
+ auto hlfirExpr = hlfir::AsExprOp::create (builder, loc, temp, mustFree);
136
136
return hlfir::Entity{hlfirExpr};
137
137
}
138
138
@@ -147,14 +147,14 @@ fir::factory::SimpleCopy::SimpleCopy(mlir::Location loc,
147
147
// Use hlfir.as_expr and hlfir.associate to create a copy and leave
148
148
// bufferization deals with how best to make the copy.
149
149
if (source.isVariable ())
150
- source = hlfir::Entity{builder. create < hlfir::AsExprOp>( loc, source)};
150
+ source = hlfir::Entity{hlfir::AsExprOp::create (builder, loc, source)};
151
151
copy = hlfir::genAssociateExpr (loc, builder, source,
152
152
source.getFortranElementType (), tempName);
153
153
}
154
154
155
155
void fir::factory::SimpleCopy::destroy (mlir::Location loc,
156
156
fir::FirOpBuilder &builder) {
157
- builder. create < hlfir::EndAssociateOp>( loc, copy);
157
+ hlfir::EndAssociateOp::create (builder, loc, copy);
158
158
}
159
159
160
160
// ===----------------------------------------------------------------------===//
@@ -279,7 +279,7 @@ mlir::Value fir::factory::AnyVariableStack::fetch(mlir::Location loc,
279
279
mlir::Value indexValue = counter.getAndIncrementIndex (loc, builder);
280
280
fir::runtime::genDescriptorAt (loc, builder, opaquePtr, indexValue,
281
281
retValueBox);
282
- hlfir::Entity retBox{builder. create < fir::LoadOp>( loc, retValueBox)};
282
+ hlfir::Entity retBox{fir::LoadOp::create (builder, loc, retValueBox)};
283
283
// The runtime always tracks variable as address, but the form of the variable
284
284
// that was saved may be different (raw address, fir.boxchar), ensure
285
285
// the returned variable has the same form of the one that was saved.
@@ -326,7 +326,7 @@ void fir::factory::AnyVectorSubscriptStack::pushShape(
326
326
hlfir::getFortranElementOrSequenceType (*boxType));
327
327
mlir::Value null = builder.createNullConstant (loc, refType);
328
328
mlir::Value descriptor =
329
- builder. create < fir::EmboxOp>( loc, *boxType, null, shape);
329
+ fir::EmboxOp::create (builder, loc, *boxType, null, shape);
330
330
shapeTemp->pushValue (loc, builder, descriptor);
331
331
return ;
332
332
}
@@ -372,7 +372,7 @@ void fir::factory::AnyAddressStack::pushValue(mlir::Location loc,
372
372
mlir::Value cast = variable;
373
373
if (auto boxProcType = llvm::dyn_cast<fir::BoxProcType>(variable.getType ())) {
374
374
cast =
375
- builder. create < fir::BoxAddrOp>( loc, boxProcType.getEleTy (), variable);
375
+ fir::BoxAddrOp::create (builder, loc, boxProcType.getEleTy (), variable);
376
376
}
377
377
cast = builder.createConvert (loc, builder.getIntPtrType (), cast);
378
378
static_cast <AnyValueStack *>(this )->pushValue (loc, builder, cast);
@@ -383,7 +383,7 @@ mlir::Value fir::factory::AnyAddressStack::fetch(mlir::Location loc,
383
383
mlir::Value addr = static_cast <AnyValueStack *>(this )->fetch (loc, builder);
384
384
if (auto boxProcType = llvm::dyn_cast<fir::BoxProcType>(addressType)) {
385
385
mlir::Value cast = builder.createConvert (loc, boxProcType.getEleTy (), addr);
386
- return builder. create < fir::EmboxProcOp>( loc, boxProcType, cast);
386
+ return fir::EmboxProcOp::create (builder, loc, boxProcType, cast);
387
387
}
388
388
return builder.createConvert (loc, addressType, addr);
389
389
}
0 commit comments