@@ -52,33 +52,33 @@ Value createPredicate(OpBuilder &builder, tblgen::Pred pred) {
5252 }
5353 if (combiner == " PredCombinerAnd" ) {
5454 auto op =
55- builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
55+ irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
5656 return op.getOutput ();
5757 }
5858 auto op =
59- builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), constraints);
59+ irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), constraints);
6060 return op.getOutput ();
6161 }
6262 }
6363
6464 std::string condition = pred.getCondition ();
6565 // Build a CPredOp to match the C constraint built.
66- irdl::CPredOp op = builder. create < irdl::CPredOp>(
67- UnknownLoc::get (ctx), StringAttr::get (ctx, condition));
66+ irdl::CPredOp op = irdl::CPredOp::create (builder, UnknownLoc::get (ctx),
67+ StringAttr::get (ctx, condition));
6868 return op;
6969}
7070
7171Value typeToConstraint (OpBuilder &builder, Type type) {
7272 MLIRContext *ctx = builder.getContext ();
7373 auto op =
74- builder. create < irdl::IsOp>( UnknownLoc::get (ctx), TypeAttr::get (type));
74+ irdl::IsOp::create (builder, UnknownLoc::get (ctx), TypeAttr::get (type));
7575 return op.getOutput ();
7676}
7777
7878Value baseToConstraint (OpBuilder &builder, StringRef baseClass) {
7979 MLIRContext *ctx = builder.getContext ();
80- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx),
81- StringAttr::get (ctx, baseClass));
80+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
81+ StringAttr::get (ctx, baseClass));
8282 return op.getOutput ();
8383}
8484
@@ -179,7 +179,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
179179 return createTypeConstraint (builder, predRec.getValueAsDef (" baseType" ));
180180
181181 if (predRec.getName () == " AnyType" ) {
182- auto op = builder. create < irdl::AnyOp>( UnknownLoc::get (ctx));
182+ auto op = irdl::AnyOp::create (builder, UnknownLoc::get (ctx));
183183 return op.getOutput ();
184184 }
185185
@@ -190,12 +190,12 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
190190 SmallVector<FlatSymbolRefAttr> nested = {
191191 SymbolRefAttr::get (ctx, combined)};
192192 auto typeSymbol = SymbolRefAttr::get (ctx, dialect, nested);
193- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx), typeSymbol);
193+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx), typeSymbol);
194194 return op.getOutput ();
195195 }
196196 std::string typeName = (" !" + predRec.getValueAsString (" typeName" )).str ();
197- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx),
198- StringAttr::get (ctx, typeName));
197+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
198+ StringAttr::get (ctx, typeName));
199199 return op.getOutput ();
200200 }
201201
@@ -205,7 +205,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
205205 constraints.push_back (
206206 createTypeConstraint (builder, tblgen::Constraint (child)));
207207 }
208- auto op = builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), constraints);
208+ auto op = irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), constraints);
209209 return op.getOutput ();
210210 }
211211
@@ -215,14 +215,14 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
215215 constraints.push_back (
216216 createTypeConstraint (builder, tblgen::Constraint (child)));
217217 }
218- auto op = builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
218+ auto op = irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
219219 return op.getOutput ();
220220 }
221221
222222 // Integer types
223223 if (predRec.getName () == " AnyInteger" ) {
224- auto op = builder. create < irdl::BaseOp>(
225- UnknownLoc::get (ctx), StringAttr::get (ctx, " !builtin.integer" ));
224+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
225+ StringAttr::get (ctx, " !builtin.integer" ));
226226 return op.getOutput ();
227227 }
228228
@@ -235,7 +235,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
235235 IntegerType::get (ctx, width, IntegerType::Signed)),
236236 typeToConstraint (builder,
237237 IntegerType::get (ctx, width, IntegerType::Unsigned))};
238- auto op = builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), types);
238+ auto op = irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), types);
239239 return op.getOutput ();
240240 }
241241
@@ -253,7 +253,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
253253 for (const Record *child : predRec.getValueAsListOfDefs (" predicateList" )) {
254254 constraints.push_back (createPredicate (builder, tblgen::Pred (child)));
255255 }
256- auto op = builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
256+ auto op = irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
257257 return op.getOutput ();
258258 }
259259
@@ -279,7 +279,7 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
279279 constraints.push_back (createPredicate (
280280 builder, tblgen::Pred (child->getValueAsDef (" predicate" ))));
281281 }
282- auto op = builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
282+ auto op = irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
283283 return op.getOutput ();
284284 }
285285
@@ -290,12 +290,12 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
290290 constraints.push_back (
291291 createAttrConstraint (builder, tblgen::Constraint (child)));
292292 }
293- auto op = builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), constraints);
293+ auto op = irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), constraints);
294294 return op.getOutput ();
295295 }
296296
297297 if (predRec.getName () == " AnyAttr" ) {
298- auto op = builder. create < irdl::AnyOp>( UnknownLoc::get (ctx));
298+ auto op = irdl::AnyOp::create (builder, UnknownLoc::get (ctx));
299299 return op.getOutput ();
300300 }
301301
@@ -317,7 +317,7 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
317317
318318 if (predRec.getName () == " UnitAttr" ) {
319319 auto op =
320- builder. create < irdl::IsOp>( UnknownLoc::get (ctx), UnitAttr::get (ctx));
320+ irdl::IsOp::create (builder, UnknownLoc::get (ctx), UnitAttr::get (ctx));
321321 return op.getOutput ();
322322 }
323323
@@ -329,12 +329,12 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
329329
330330 };
331331 auto typeSymbol = SymbolRefAttr::get (ctx, dialect, nested);
332- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx), typeSymbol);
332+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx), typeSymbol);
333333 return op.getOutput ();
334334 }
335335 std::string typeName = (" #" + predRec.getValueAsString (" attrName" )).str ();
336- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx),
337- StringAttr::get (ctx, typeName));
336+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
337+ StringAttr::get (ctx, typeName));
338338 return op.getOutput ();
339339 }
340340
@@ -348,15 +348,15 @@ Value createRegionConstraint(OpBuilder &builder, tblgen::Region constraint) {
348348 if (predRec.getName () == " AnyRegion" ) {
349349 ValueRange entryBlockArgs = {};
350350 auto op =
351- builder. create < irdl::RegionOp>( UnknownLoc::get (ctx), entryBlockArgs);
351+ irdl::RegionOp::create (builder, UnknownLoc::get (ctx), entryBlockArgs);
352352 return op.getResult ();
353353 }
354354
355355 if (predRec.isSubClassOf (" SizedRegion" )) {
356356 ValueRange entryBlockArgs = {};
357357 auto ty = IntegerType::get (ctx, 32 );
358- auto op = builder. create < irdl::RegionOp> (
359- UnknownLoc::get (ctx), entryBlockArgs,
358+ auto op = irdl::RegionOp::create (
359+ builder, UnknownLoc::get (ctx), entryBlockArgs,
360360 IntegerAttr::get (ty, predRec.getValueAsInt (" blocks" )));
361361 return op.getResult ();
362362 }
@@ -388,8 +388,8 @@ irdl::OperationOp createIRDLOperation(OpBuilder &builder,
388388 MLIRContext *ctx = builder.getContext ();
389389 StringRef opName = getOperatorName (tblgenOp);
390390
391- irdl::OperationOp op = builder. create < irdl::OperationOp> (
392- UnknownLoc::get (ctx), StringAttr::get (ctx, opName));
391+ irdl::OperationOp op = irdl::OperationOp::create (
392+ builder, UnknownLoc::get (ctx), StringAttr::get (ctx, opName));
393393
394394 // Add the block in the region.
395395 Block &opBlock = op.getBody ().emplaceBlock ();
@@ -471,19 +471,19 @@ irdl::OperationOp createIRDLOperation(OpBuilder &builder,
471471
472472 // Create the operands and results operations.
473473 if (!operands.empty ())
474- consBuilder. create < irdl::OperandsOp>( UnknownLoc::get (ctx), operands,
475- ArrayAttr::get (ctx, operandNames),
476- operandVariadicity);
474+ irdl::OperandsOp::create (consBuilder, UnknownLoc::get (ctx), operands,
475+ ArrayAttr::get (ctx, operandNames),
476+ operandVariadicity);
477477 if (!results.empty ())
478- consBuilder. create < irdl::ResultsOp>( UnknownLoc::get (ctx), results,
479- ArrayAttr::get (ctx, resultNames),
480- resultVariadicity);
478+ irdl::ResultsOp::create (consBuilder, UnknownLoc::get (ctx), results,
479+ ArrayAttr::get (ctx, resultNames),
480+ resultVariadicity);
481481 if (!attributes.empty ())
482- consBuilder. create < irdl::AttributesOp>( UnknownLoc::get (ctx), attributes,
483- ArrayAttr::get (ctx, attrNames));
482+ irdl::AttributesOp::create (consBuilder, UnknownLoc::get (ctx), attributes,
483+ ArrayAttr::get (ctx, attrNames));
484484 if (!regions.empty ())
485- consBuilder. create < irdl::RegionsOp>( UnknownLoc::get (ctx), regions,
486- ArrayAttr::get (ctx, regionNames));
485+ irdl::RegionsOp::create (consBuilder, UnknownLoc::get (ctx), regions,
486+ ArrayAttr::get (ctx, regionNames));
487487
488488 return op;
489489}
@@ -493,8 +493,8 @@ irdl::TypeOp createIRDLType(OpBuilder &builder, tblgen::TypeDef &tblgenType) {
493493 StringRef typeName = getTypeName (tblgenType);
494494 std::string combined = (" !" + typeName).str ();
495495
496- irdl::TypeOp op = builder. create < irdl::TypeOp>(
497- UnknownLoc::get (ctx), StringAttr::get (ctx, combined));
496+ irdl::TypeOp op = irdl::TypeOp::create (builder, UnknownLoc::get (ctx),
497+ StringAttr::get (ctx, combined));
498498
499499 op.getBody ().emplaceBlock ();
500500
@@ -507,8 +507,8 @@ irdl::AttributeOp createIRDLAttr(OpBuilder &builder,
507507 StringRef attrName = getAttrName (tblgenAttr);
508508 std::string combined = (" #" + attrName).str ();
509509
510- irdl::AttributeOp op = builder. create < irdl::AttributeOp> (
511- UnknownLoc::get (ctx), StringAttr::get (ctx, combined));
510+ irdl::AttributeOp op = irdl::AttributeOp::create (
511+ builder, UnknownLoc::get (ctx), StringAttr::get (ctx, combined));
512512
513513 op.getBody ().emplaceBlock ();
514514
@@ -517,8 +517,8 @@ irdl::AttributeOp createIRDLAttr(OpBuilder &builder,
517517
518518static irdl::DialectOp createIRDLDialect (OpBuilder &builder) {
519519 MLIRContext *ctx = builder.getContext ();
520- return builder. create < irdl::DialectOp>( UnknownLoc::get (ctx),
521- StringAttr::get (ctx, selectedDialect));
520+ return irdl::DialectOp::create (builder, UnknownLoc::get (ctx),
521+ StringAttr::get (ctx, selectedDialect));
522522}
523523
524524static bool emitDialectIRDLDefs (const RecordKeeper &records, raw_ostream &os) {
@@ -529,7 +529,7 @@ static bool emitDialectIRDLDefs(const RecordKeeper &records, raw_ostream &os) {
529529
530530 // Create a module op and set it as the insertion point.
531531 OwningOpRef<ModuleOp> module =
532- builder. create < ModuleOp>( UnknownLoc::get (&ctx));
532+ ModuleOp::create (builder, UnknownLoc::get (&ctx));
533533 builder = builder.atBlockBegin (module ->getBody ());
534534 // Create the dialect and insert it.
535535 irdl::DialectOp dialect = createIRDLDialect (builder);
0 commit comments