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

Jefferson Le Quellec llvmlistbot at llvm.org
Thu Nov 14 00:38:13 PST 2024


https://github.com/jle-quel created https://github.com/llvm/llvm-project/pull/116183

## Description

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



>From 6df1eb11cfc2b910d5445b9e0471830994414631 Mon Sep 17 00:00:00 2001
From: Jefferson Le Quellec <jefferson.lequellec at codeplay.com>
Date: Thu, 14 Nov 2024 09:24:10 +0100
Subject: [PATCH] Fix missing C++ specifiers in documentation

---
 mlir/docs/PatternRewriter.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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