[Mlir-commits] [mlir] 9d8950a - [mlir] 'dyn_cast' is deprecated: Use mlir::dyn_cast<U>() instead (NFC)

Jie Fu llvmlistbot at llvm.org
Sun Sep 8 18:01:12 PDT 2024


Author: Jie Fu
Date: 2024-09-09T09:00:15+08:00
New Revision: 9d8950a8d98708e73f6352f9664deac2ed8f910c

URL: https://github.com/llvm/llvm-project/commit/9d8950a8d98708e73f6352f9664deac2ed8f910c
DIFF: https://github.com/llvm/llvm-project/commit/9d8950a8d98708e73f6352f9664deac2ed8f910c.diff

LOG: [mlir] 'dyn_cast' is deprecated: Use mlir::dyn_cast<U>() instead (NFC)

/llvm-project/mlir/lib/Dialect/Vector/IR/VectorOps.cpp:2923:29: error: 'dyn_cast' is deprecated: Use mlir::dyn_cast<U>() instead [-Werror,-Wdeprecated-declarations]
 2923 |     if (auto intAttr = attr.dyn_cast<IntegerAttr>()) {
      |                             ^
/llvm-project/mlir/include/mlir/IR/Attributes.h:184:14: note: 'dyn_cast' has been explicitly marked deprecated here
  184 | U Attribute::dyn_cast() const {
      |              ^

Added: 
    

Modified: 
    mlir/lib/Dialect/Vector/IR/VectorOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index b62f1fa5992958..d3aef4ac38af03 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -2920,7 +2920,7 @@ class InsertOpConstantFolder final : public OpRewritePattern<InsertOp> {
   /// Converts the expected type to an IntegerAttr if there's
   /// a mismatch.
   Attribute convertIntegerAttr(Attribute attr, Type expectedType) const {
-    if (auto intAttr = attr.dyn_cast<IntegerAttr>()) {
+    if (auto intAttr = mlir::dyn_cast<IntegerAttr>(attr)) {
       if (intAttr.getType() != expectedType)
         return IntegerAttr::get(expectedType, intAttr.getInt());
     }


        


More information about the Mlir-commits mailing list