From c8944c9d4cd94dd676aff1e92a00ff0a0b285002 Mon Sep 17 00:00:00 2001 From: wren romano <2998727+wrengr@users.noreply.github.com> Date: Thu, 29 Sep 2022 17:24:01 -0700 Subject: [PATCH] [mlir][sparse] Fixing case coverage warning Followup to D133835 for fixing the warning on LLVM's Windows buildbot Reviewed By: aartbik, Peiming, stella.stamenova Differential Revision: https://reviews.llvm.org/D134925 --- mlir/include/mlir/ExecutionEngine/SparseTensor/File.h | 2 +- mlir/lib/ExecutionEngine/SparseTensor/File.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mlir/include/mlir/ExecutionEngine/SparseTensor/File.h b/mlir/include/mlir/ExecutionEngine/SparseTensor/File.h index fb00e1e..920246c 100644 --- a/mlir/include/mlir/ExecutionEngine/SparseTensor/File.h +++ b/mlir/include/mlir/ExecutionEngine/SparseTensor/File.h @@ -44,7 +44,7 @@ namespace sparse_tensor { /// as well as providing the buffers and methods for parsing those headers. class SparseTensorFile final { public: - enum class ValueKind { + enum class ValueKind : uint8_t { // The value before calling `readHeader`. kInvalid = 0, // Values that can be set by `readMMEHeader`. diff --git a/mlir/lib/ExecutionEngine/SparseTensor/File.cpp b/mlir/lib/ExecutionEngine/SparseTensor/File.cpp index 2ea00b3..dfe3e55 100644 --- a/mlir/lib/ExecutionEngine/SparseTensor/File.cpp +++ b/mlir/lib/ExecutionEngine/SparseTensor/File.cpp @@ -107,6 +107,9 @@ bool SparseTensorFile::canReadAs(PrimaryType valTy) const { // So we allow implicitly converting the stored values to both // integer and floating primary-types. return isRealPrimaryType(valTy); + default: + MLIR_SPARSETENSOR_FATAL("Unknown ValueKind: %d\n", + static_cast(valueKind_)); } } -- 2.7.4