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,14 +107,19 @@ 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); // Verify that the registered pass has the same ID as any registered to this // arg before it. - TypeID entryTypeID = function()->getTypeID(); + TypeID entryTypeID = pass->getTypeID(); auto it = passRegistryTypeIDs->try_emplace(arg, entryTypeID).first; if (it->second != entryTypeID) llvm::report_fatal_error( @@ -123,16 +128,6 @@ arg); } -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()`: " + - pass->getName()); - 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);