[mlir][sparse] Fixing case coverage warning
authorwren romano <2998727+wrengr@users.noreply.github.com>
Fri, 30 Sep 2022 00:24:01 +0000 (17:24 -0700)
committerwren romano <2998727+wrengr@users.noreply.github.com>
Fri, 30 Sep 2022 01:20:36 +0000 (18:20 -0700)
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
mlir/lib/ExecutionEngine/SparseTensor/File.cpp

index fb00e1e..920246c 100644 (file)
@@ -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`.
index 2ea00b3..dfe3e55 100644 (file)
@@ -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<uint8_t>(valueKind_));
   }
 }