diff --git a/mlir/include/mlir/Pass/PassRegistry.h b/mlir/include/mlir/Pass/PassRegistry.h --- a/mlir/include/mlir/Pass/PassRegistry.h +++ b/mlir/include/mlir/Pass/PassRegistry.h @@ -123,12 +123,6 @@ std::function)> optHandler); -/// Register a specific dialect pass allocator function with the system, -/// typically used through the PassRegistration template. -/// Deprecated: please use the alternate version below. -void registerPass(StringRef arg, StringRef description, - const PassAllocatorFunction &function); - /// Register a specific dialect pass allocator function with the system, /// typically used through the PassRegistration template. void registerPass(const PassAllocatorFunction &function); @@ -149,17 +143,6 @@ } PassRegistration() : PassRegistration([] { return std::make_unique(); }) {} - - /// Constructor below are deprecated. - - PassRegistration(StringRef arg, StringRef description, - const PassAllocatorFunction &constructor) { - registerPass(arg, description, constructor); - } - - PassRegistration(StringRef arg, StringRef description) - : PassRegistration(arg, description, - [] { return std::make_unique(); }) {} }; /// PassPipelineRegistration provides a global initializer that registers a Pass diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp --- a/mlir/lib/Pass/PassRegistry.cpp +++ b/mlir/lib/Pass/PassRegistry.cpp @@ -107,8 +107,13 @@ optHandler(allocator()->passOptions); }) {} -void mlir::registerPass(StringRef arg, StringRef description, - const PassAllocatorFunction &function) { +void mlir::registerPass(const PassAllocatorFunction &function) { + std::unique_ptr pass = function(); + StringRef arg = pass->getArgument(); + if (arg.empty()) + llvm::report_fatal_error( + "Trying to register a pass that does not override `getArgument()`"); + StringRef description = pass->getDescription(); PassInfo passInfo(arg, description, function); passRegistry->try_emplace(arg, passInfo); @@ -122,15 +127,6 @@ } } -void mlir::registerPass(const PassAllocatorFunction &function) { - std::unique_ptr pass = function(); - StringRef arg = pass->getArgument(); - if (arg.empty()) - llvm::report_fatal_error( - "Trying to register a pass that does not override `getArgument()`"); - registerPass(arg, pass->getDescription(), function); -} - /// Returns the pass info for the specified pass argument or null if unknown. const PassInfo *mlir::Pass::lookupPassInfo(StringRef passArg) { auto it = passRegistry->find(passArg);