================
@@ -66,10 +86,25 @@ void f() {
mlir::ImplicitLocOpBuilder ib;
// CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use 'OpType::create(builder,
...)' instead of 'builder.create<OpType>(...)' [llvm-use-new-mlir-op-builder]
- // CHECK-FIXES: mlir::ModuleOp::create(ib);
+ // CHECK-FIXES: mlir::ModuleOp::create(ib );
ib.create<mlir::ModuleOp>( );
// CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use 'OpType::create(builder,
...)' instead of 'builder.create<OpType>(...)' [llvm-use-new-mlir-op-builder]
// CHECK-FIXES:
mlir::OpBuilder().create<mlir::ModuleOp>(builder.getUnknownLoc());
mlir::OpBuilder().create<mlir::ModuleOp>(builder.getUnknownLoc());
+
+ auto *p = &builder;
+ // CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use 'OpType::create(builder,
...)'
+ // CHECK-FIXES: NamedOp::create(*p, builder.getUnknownLoc(), "eaz");
+ p->create<NamedOp>(builder.getUnknownLoc(), "eaz");
+
+ CustomBuilder cb;
+ cb.f("faz");
+
+ // CHECK-MESSAGES: :[[@LINE+4]]:3: warning: use 'OpType::create(builder,
...)' instead of 'builder.create<OpType>(...)' [llvm-use-new-mlir-op-builder]
+ // CHECK-FIXES: OperandOp::create(builder, builder.getUnknownLoc(),
+ // CHECK-MESSAGES: :[[@LINE+3]]:5: warning: use 'OpType::create(builder,
...)' instead of 'builder.create<OpType>(...)' [llvm-use-new-mlir-op-builder]
+ // CHECK-FIXES: NamedOp::create(builder, builder.getUnknownLoc(),
"gaz").getResult());
----------------
jpienaar wrote:
Good question, I had kept them separate as its two different reports (so a
report and its fixed together rather than separate per type). No strong
feelings about this, I can make it match whole.
https://github.com/llvm/llvm-project/pull/159423
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits