[all-commits] [llvm/llvm-project] 02c905: [mlir] Tighten access of RewritePattern methods.

Christian Sigg via All-commits all-commits at lists.llvm.org
Tue Dec 8 07:45:17 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02c9050155dff70497b3423ae95ed7d2ab7675a8
      https://github.com/llvm/llvm-project/commit/02c9050155dff70497b3423ae95ed7d2ab7675a8
  Author: Christian Sigg <csigg at google.com>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/Transforms/DialectConversion.h

  Log Message:
  -----------
  [mlir] Tighten access of RewritePattern methods.

In RewritePattern, only expose `matchAndRewrite` as a public function. `match` can be protected (but needs to be protected because we want to call it from an override of `matchAndRewrite`). `rewrite` can be private.

For classes deriving from RewritePattern, all 3 functions can be private.

Side note: I didn't understand the need for the `using RewritePattern::matchAndRewrite` in derived classes, and started poking around. They are gone now, and I think the result is (only very slightly) cleaner.

Reviewed By: ftynse

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




More information about the All-commits mailing list