[Mlir-commits] [mlir] 1c8c2fd - [mlir] Fix -Wdeprecated-declarations in BufferResultsToOutParams.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Tue May 7 19:39:28 PDT 2024


Author: Jie Fu
Date: 2024-05-08T10:38:34+08:00
New Revision: 1c8c2fdd289075d6ef448f60db9dd30caf7f78df

URL: https://github.com/llvm/llvm-project/commit/1c8c2fdd289075d6ef448f60db9dd30caf7f78df
DIFF: https://github.com/llvm/llvm-project/commit/1c8c2fdd289075d6ef448f60db9dd30caf7f78df.diff

LOG: [mlir] Fix -Wdeprecated-declarations in BufferResultsToOutParams.cpp (NFC)

/llvm-project/mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp:124:26:
error: 'cast' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
  124 |           orig.getType().cast<MemRefType>().hasStaticShape()) {
      |

Added: 
    

Modified: 
    mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp b/mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp
index a5f01eadb2134..b19636adaa69e 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp
@@ -121,7 +121,7 @@ static LogicalResult updateReturnOps(func::FuncOp func,
     OpBuilder builder(op);
     for (auto [orig, arg] : llvm::zip(copyIntoOutParams, appendedEntryArgs)) {
       if (hoistStaticAllocs && isa<memref::AllocOp>(orig.getDefiningOp()) &&
-          orig.getType().cast<MemRefType>().hasStaticShape()) {
+          mlir::cast<MemRefType>(orig.getType()).hasStaticShape()) {
         orig.replaceAllUsesWith(arg);
         orig.getDefiningOp()->erase();
       } else {


        


More information about the Mlir-commits mailing list