[all-commits] [llvm/llvm-project] ee4d03: Change pass registration generated code to allow u...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Apr 2 11:59:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ee4d0342771a42b8485416bfdadc7da4ec4732dc
      https://github.com/llvm/llvm-project/commit/ee4d0342771a42b8485416bfdadc7da4ec4732dc
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M mlir/tools/mlir-tblgen/PassGen.cpp

  Log Message:
  -----------
  Change pass registration generated code to allow users to selectively register passes

This slightly tweaks the generated code from:

  #ifdef GEN_PASS_REGISTRATION
  ::mlir::registerPass("flag1", ...
  ::mlir::registerPass("flag2", ...
  #endif // GEN_PASS_REGISTRATION

to:

  #ifdef GEN_PASS_REGISTRATION
  #define GEN_PASS_REGISTRATION_Pass1
  #define GEN_PASS_REGISTRATION_Pass2
  #endif // GEN_PASS_REGISTRATION

  #ifdef GEN_PASS_REGISTRATION_Pass1
  ::mlir::registerPass("flag1", ...
  #endif
  #ifdef GEN_PASS_REGISTRATION_Pass1
  ::mlir::registerPass("flag2", ...
  #endif

That way the generated code can be included by defining the
`GEN_PASS_REGISTRATION` macro as currenty and register all the passes,
but one can also define only `GEN_PASS_REGISTRATION_Pass1` to register a
subset of the passes.

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




More information about the All-commits mailing list