[Mlir-commits] [mlir] c730c62 - [mlir] Fix -Wctad-maybe-unsupported in MemRefUtils.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Thu Aug 17 16:15:20 PDT 2023


Author: Jie Fu
Date: 2023-08-18T07:13:48+08:00
New Revision: c730c6271553d335b26a42d55f6ce4f59bff2a89

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

LOG: [mlir] Fix -Wctad-maybe-unsupported in MemRefUtils.cpp (NFC)

/Users/jiefu/llvm-project/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp:56:3: error: 'SmallVector' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
  SmallVector indicesVec = llvm::to_vector(indices);
  ^
/Users/jiefu/llvm-project/mlir/include/mlir/Support/LLVM.h:69:7: note: add a deduction guide to suppress this warning
class SmallVector;
      ^
1 error generated.

Added: 
    

Modified: 
    mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp b/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp
index e640248af6e499..7b0791da83ee4a 100644
--- a/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp
+++ b/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp
@@ -53,7 +53,7 @@ std::pair<LinearizedMemRefInfo, OpFoldResult> getLinearizedMemRefOffsetAndSize(
   unsigned sourceRank = sizes.size();
   assert(sizes.size() == strides.size() &&
          "expected as many sizes as strides for a memref");
-  SmallVector indicesVec = llvm::to_vector(indices);
+  SmallVector<OpFoldResult> indicesVec = llvm::to_vector(indices);
   if (indices.empty())
     indicesVec.resize(sourceRank, builder.getIndexAttr(0));
   assert(indicesVec.size() == strides.size() &&


        


More information about the Mlir-commits mailing list