[mlir] Fix deprecation warnings (NFC)
authorKazu Hirata <kazu@google.com>
Mon, 12 Sep 2022 15:52:51 +0000 (08:52 -0700)
committerKazu Hirata <kazu@google.com>
Mon, 12 Sep 2022 15:52:51 +0000 (08:52 -0700)
This patch fixes a couple of warnings by switching to has_value/value:

  mlir/lib/Dialect/Vector/IR/VectorOps.cpp:529:28: error: 'hasValue'
  is deprecated: Use has_value
  instead. [-Werror,-Wdeprecated-declarations]

  mlir/lib/Dialect/Vector/IR/VectorOps.cpp:533:48: error: 'getValue'
  is deprecated: Use value
  instead. [-Werror,-Wdeprecated-declarations]

mlir/lib/Dialect/Vector/IR/VectorOps.cpp

index 78ccb1f..5e1b95e 100644 (file)
@@ -526,11 +526,11 @@ ParseResult ContractionOp::parse(OpAsmParser &parser, OperationState &result) {
 
   for (StringRef s : iteratorTypes.getAsValueRange<StringAttr>()) {
     auto maybeIteratorType = symbolizeIteratorType(s);
-    if (!maybeIteratorType.hasValue())
+    if (!maybeIteratorType.has_value())
       return parser.emitError(loc) << "unexpected iterator_type (" << s << ")";
 
     iteratorTypeAttrs.push_back(IteratorTypeAttr::get(
-        parser.getContext(), maybeIteratorType.getValue()));
+        parser.getContext(), maybeIteratorType.value()));
   }
   result.attributes.set("iterator_types",
                         parser.getBuilder().getArrayAttr(iteratorTypeAttrs));