[Mlir-commits] [mlir] eaa6cde - [mlir][sparse] Making deletion of SparseTensorType copy-assignment explicit

wren romano llvmlistbot at llvm.org
Wed Mar 8 15:22:28 PST 2023


Author: wren romano
Date: 2023-03-08T15:22:21-08:00
New Revision: eaa6cdeaf6651b2aff03bd6a6c044641f0cbc2a9

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

LOG: [mlir][sparse] Making deletion of SparseTensorType copy-assignment explicit

The copy assignment is already implicitly deleted, but making it explicit helps clean up compilation error messages.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D145606

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h
index 6b6163e75fdeb..9d22f5220e96a 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h
@@ -58,6 +58,10 @@ class SparseTensorType {
       : SparseTensorType(
             RankedTensorType::get(stp.getShape(), stp.getElementType(), enc)) {}
 
+  // Copy-assignment would be implicitly deleted (because our fields
+  // are const), so we explicitly delete it for clarity.
+  SparseTensorType &operator=(const SparseTensorType &) = delete;
+
   /// Constructs a new `SparseTensorType` with the same dimension-shape
   /// and element type, but with the encoding replaced by the given encoding.
   SparseTensorType withEncoding(SparseTensorEncodingAttr newEnc) const {


        


More information about the Mlir-commits mailing list