[Mlir-commits] [mlir] b512b1c - Migrate "CheckUses" pass to the auto-generated constructor (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Fri Sep 2 09:56:11 PDT 2022
Author: Mehdi Amini
Date: 2022-09-02T16:55:51Z
New Revision: b512b1c809843d4b65b20dc356ab06b50602580b
URL: https://github.com/llvm/llvm-project/commit/b512b1c809843d4b65b20dc356ab06b50602580b
DIFF: https://github.com/llvm/llvm-project/commit/b512b1c809843d4b65b20dc356ab06b50602580b.diff
LOG: Migrate "CheckUses" pass to the auto-generated constructor (NFC)
See #57475
Differential Revision: https://reviews.llvm.org/D133215
Added:
Modified:
mlir/include/mlir/Dialect/Transform/Transforms/Passes.h
mlir/include/mlir/Dialect/Transform/Transforms/Passes.td
mlir/lib/Dialect/Transform/Transforms/CheckUses.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Transform/Transforms/Passes.h b/mlir/include/mlir/Dialect/Transform/Transforms/Passes.h
index ac33cb457a38d..be5cbd500b1c4 100644
--- a/mlir/include/mlir/Dialect/Transform/Transforms/Passes.h
+++ b/mlir/include/mlir/Dialect/Transform/Transforms/Passes.h
@@ -16,11 +16,9 @@ namespace mlir {
class Pass;
namespace transform {
-#define GEN_PASS_DECL_CHECKUSES
+#define GEN_PASS_DECL_CHECKUSESPASS
#include "mlir/Dialect/Transform/Transforms/Passes.h.inc"
-std::unique_ptr<Pass> createCheckUsesPass();
-
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/Transform/Transforms/Passes.h.inc"
} // namespace transform
diff --git a/mlir/include/mlir/Dialect/Transform/Transforms/Passes.td b/mlir/include/mlir/Dialect/Transform/Transforms/Passes.td
index 1d7d8652c6501..4fdd2e3d875ff 100644
--- a/mlir/include/mlir/Dialect/Transform/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/Transform/Transforms/Passes.td
@@ -11,7 +11,7 @@
include "mlir/Pass/PassBase.td"
-def CheckUses : Pass<"transform-dialect-check-uses"> {
+def CheckUsesPass : Pass<"transform-dialect-check-uses"> {
let summary = "warn about potential use-after-free in the transform dialect";
let description = [{
This pass analyzes operations from the transform dialect and its extensions
@@ -30,7 +30,6 @@ def CheckUses : Pass<"transform-dialect-check-uses"> {
prior to this pass provided that transform ops implement the relevant
control flow interfaces.
}];
- let constructor = "::mlir::transform::createCheckUsesPass()";
}
#endif // MLIR_DIALECT_TRANSFORM_TRANSFORMS_PASSES
diff --git a/mlir/lib/Dialect/Transform/Transforms/CheckUses.cpp b/mlir/lib/Dialect/Transform/Transforms/CheckUses.cpp
index dbb03e0b36091..94a3c8a6c6fd8 100644
--- a/mlir/lib/Dialect/Transform/Transforms/CheckUses.cpp
+++ b/mlir/lib/Dialect/Transform/Transforms/CheckUses.cpp
@@ -20,7 +20,7 @@
namespace mlir {
namespace transform {
-#define GEN_PASS_DEF_CHECKUSES
+#define GEN_PASS_DEF_CHECKUSESPASS
#include "mlir/Dialect/Transform/Transforms/Passes.h.inc"
} // namespace transform
} // namespace mlir
@@ -371,7 +371,7 @@ class TransformOpMemFreeAnalysis {
//// A simple pass that warns about any use of a value by a transform operation
// that may be using the value after it has been freed.
-class CheckUsesPass : public transform::impl::CheckUsesBase<CheckUsesPass> {
+class CheckUsesPass : public transform::impl::CheckUsesPassBase<CheckUsesPass> {
public:
void runOnOperation() override {
auto &analysis = getAnalysis<TransformOpMemFreeAnalysis>();
@@ -397,10 +397,3 @@ class CheckUsesPass : public transform::impl::CheckUsesBase<CheckUsesPass> {
} // namespace
-namespace mlir {
-namespace transform {
-std::unique_ptr<Pass> createCheckUsesPass() {
- return std::make_unique<CheckUsesPass>();
-}
-} // namespace transform
-} // namespace mlir
More information about the Mlir-commits
mailing list