================
@@ -0,0 +1,51 @@
+// RUN: %check_clang_tidy --match-partial-fixes %s llvm-mlir-op-builder %t
+
+namespace mlir {
+class Location {};
+class OpBuilder {
+public:
+  template <typename OpTy, typename... Args>
+  OpTy create(Location location, Args &&...args) {
+    return OpTy(args...);
+  }
+  Location getUnknownLoc() { return Location(); }
+};
+class ImplicitLocOpBuilder : public OpBuilder {
+public:
+  template <typename OpTy, typename... Args>
+  OpTy create(Args &&...args) {
+    return OpTy(args...);
+  }
+};
+struct ModuleOp {
+  ModuleOp() {}
+  static ModuleOp create(OpBuilder &builder, Location location) {
+    return ModuleOp();
+  }
+};
+struct NamedOp {
+  NamedOp(const char* name) {}
+  static NamedOp create(OpBuilder &builder, Location location, const char* 
name) {
+    return NamedOp(name);
+  }
+};
+} // namespace mlir
+
+void f() {
----------------
jpienaar wrote:

For the macro case, the matcher matches, but the rewrite is never attempted. 
Its been a few years since I last wrote a clang-tidy check, so not sure why. If 
I change to a noopEdit then it is flagged not sure if due to returning an 
ASTEdit rather than EditGenerator. Using the latter may be possible, is rather 
low level but perhaps possible. Is there a pattern I'm missing here?

https://github.com/llvm/llvm-project/pull/149148
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to