[Mlir-commits] [mlir] 8c5a3a9 - [mlir][docs] Update MLIR's PatternRewriter documentation (#116183)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Nov 25 04:33:01 PST 2024


Author: Jefferson Le Quellec
Date: 2024-11-25T13:32:57+01:00
New Revision: 8c5a3a97c0d061880d6705db8f000aa964c3e32d

URL: https://github.com/llvm/llvm-project/commit/8c5a3a97c0d061880d6705db8f000aa964c3e32d
DIFF: https://github.com/llvm/llvm-project/commit/8c5a3a97c0d061880d6705db8f000aa964c3e32d.diff

LOG: [mlir][docs] Update MLIR's PatternRewriter documentation  (#116183)

This PR adds the missing `const override` to the `rewrite` and
`matchAndRewrite` declaration in the Pattern Rewriter documentation as
described here:

https://github.com/llvm/llvm-project/blob/5cfa8baef33636827e5aa8dd76888c724433b53e/mlir/include/mlir/IR/PatternMatch.h#L237-L265

Added: 
    

Modified: 
    mlir/docs/PatternRewriter.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/PatternRewriter.md b/mlir/docs/PatternRewriter.md
index c61ceaf81681e2..2f1483db8190a7 100644
--- a/mlir/docs/PatternRewriter.md
+++ b/mlir/docs/PatternRewriter.md
@@ -73,7 +73,7 @@ public:
     // otherwise.
     // ...
   }
-  void rewrite(Operation *op, PatternRewriter &rewriter) {
+  void rewrite(Operation *op, PatternRewriter &rewriter) const override {
     // The `rewrite` method performs mutations on the IR rooted at `op` using
     // the provided rewriter. All mutations must go through the provided
     // rewriter.
@@ -81,7 +81,7 @@ public:
 
   /// In this section, the `match` and `rewrite` implementation is specified
   /// using a single hook.
-  LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter) {
+  LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter) const override {
     // The `matchAndRewrite` method performs both the matching and the mutation.
     // Note that the match must reach a successful point before IR mutation may
     // take place.


        


More information about the Mlir-commits mailing list