Skip to content

Commit 8c5a3a9

Browse files
authored
[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
1 parent 5352478 commit 8c5a3a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/docs/PatternRewriter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ public:
7373
// otherwise.
7474
// ...
7575
}
76-
void rewrite(Operation *op, PatternRewriter &rewriter) {
76+
void rewrite(Operation *op, PatternRewriter &rewriter) const override {
7777
// The `rewrite` method performs mutations on the IR rooted at `op` using
7878
// the provided rewriter. All mutations must go through the provided
7979
// rewriter.
8080
}
8181

8282
/// In this section, the `match` and `rewrite` implementation is specified
8383
/// using a single hook.
84-
LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter) {
84+
LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter) const override {
8585
// The `matchAndRewrite` method performs both the matching and the mutation.
8686
// Note that the match must reach a successful point before IR mutation may
8787
// take place.

0 commit comments

Comments
 (0)