From bfa4ab859b0ddfd26bc4b90738e4fe76deeeb3ae Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Sat, 26 Apr 2025 20:06:15 -0400 Subject: [PATCH 1/3] Move cast member function deprecation to completed refactorings --- website/content/deprecation/_index.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/website/content/deprecation/_index.md b/website/content/deprecation/_index.md index 2881bcc65ee64..15fd51abd3a17 100644 --- a/website/content/deprecation/_index.md +++ b/website/content/deprecation/_index.md @@ -12,14 +12,6 @@ up with MLIR development. ## Deprecated -### Use the free function variants for `dyn_cast`/`cast`/`isa`/... - -When casting attributes or type, use the free functions variants, e.g., -`dyn_cast(x)`, `isa(x)`, etc. Use of the cast methods variants (e.g., -`x.dyn_cast()`) should be avoided in new code as we'll remove these -methods in the future. -[Discussion on Discourse](https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443) - ### Use `matchAndRewrite` instead of `match` / `rewrite` The `match` and `rewrite` functions of `RewritePattern` and `ConversionPattern` @@ -108,3 +100,13 @@ been implemented in upstream MLIR or any known downstream projects. Due to this lack of use, it was decided that the operation should be removed. [Discussion on Discourse](https://discourse.llvm.org/t/rfc-should-vector-reshape-be-removed/80478) + +## LLVM 21 + +### Use the free function variants for `dyn_cast`/`cast`/`isa`/... + +When casting attributes or type, use the free functions variants, e.g., +`dyn_cast(x)`, `isa(x)`, etc. Use of the cast methods variants (e.g., +`x.dyn_cast()`) should be avoided in new code as we'll remove these +methods in the future. +[Discussion on Discourse](https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443) From 08856a408f118547f158fecb77d236b6805d4669 Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Sat, 26 Apr 2025 20:10:00 -0400 Subject: [PATCH 2/3] Reword --- website/content/deprecation/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/content/deprecation/_index.md b/website/content/deprecation/_index.md index 15fd51abd3a17..eed4fb7d0c161 100644 --- a/website/content/deprecation/_index.md +++ b/website/content/deprecation/_index.md @@ -107,6 +107,6 @@ lack of use, it was decided that the operation should be removed. When casting attributes or type, use the free functions variants, e.g., `dyn_cast(x)`, `isa(x)`, etc. Use of the cast methods variants (e.g., -`x.dyn_cast()`) should be avoided in new code as we'll remove these -methods in the future. +`x.dyn_cast()`) should be avoided in new code as we removed these +methods in https://github.com/llvm/llvm-project/pull/135556. [Discussion on Discourse](https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443) From 60d7b77d73402a84f29c6a74d52a7dd41ca0249d Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Sat, 26 Apr 2025 20:10:30 -0400 Subject: [PATCH 3/3] Format --- website/content/deprecation/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/content/deprecation/_index.md b/website/content/deprecation/_index.md index eed4fb7d0c161..b2825962566e2 100644 --- a/website/content/deprecation/_index.md +++ b/website/content/deprecation/_index.md @@ -109,4 +109,5 @@ When casting attributes or type, use the free functions variants, e.g., `dyn_cast(x)`, `isa(x)`, etc. Use of the cast methods variants (e.g., `x.dyn_cast()`) should be avoided in new code as we removed these methods in https://github.com/llvm/llvm-project/pull/135556. + [Discussion on Discourse](https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443)