[all-commits] [llvm/llvm-project] 43a894: Remove deprecated registration APIs (NFC)

Mehdi Amini via All-commits all-commits at lists.llvm.org
Wed Sep 1 11:53:50 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 43a894365e6c0ac3641f8b49e77e81c20d1992f2
      https://github.com/llvm/llvm-project/commit/43a894365e6c0ac3641f8b49e77e81c20d1992f2
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2021-09-01 (Wed, 01 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Pass/PassRegistry.h
    M mlir/lib/Pass/PassRegistry.cpp

  Log Message:
  -----------
  Remove deprecated registration APIs (NFC)

In D104421, we changed the API for pass registration.
Before you would write:

      void registerPass("my-pass", "My Pass Description.",
                        [] { return createMyPass(); });
while now you’d only write:

      void registerPass([] { return createMyPass(); });

If you’re using TableGen to define your pass registration, you shouldn’t have anything to do. If you’re using directly the C++ API here are some changes.
Your project may also be broken even if you use TableGen and you call the
generated registration API in case your pass implementation didn’t inherit from
the MyPassBase class generated by TableGen.

If you don't use TableGen, the "my-pass" and "My Pass Description." fields must
be provided by overriding methods on the pass itself:

  llvm::StringRef getArgument() const final { return "my-pass"; }
  llvm::StringRef getDescription() const final {
    return "My Pass Description.";
  }

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D104429




More information about the All-commits mailing list