[Mlir-commits] [mlir] 35e5677 - [mlir][docs] Migrate away from deprecated llvm::Optional methods

Fangrui Song llvmlistbot at llvm.org
Fri Aug 19 23:29:39 PDT 2022


Author: Fangrui Song
Date: 2022-08-19T23:29:31-07:00
New Revision: 35e56771ab36975b73d641ff9cb6eb6250adb526

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

LOG: [mlir][docs] Migrate away from deprecated llvm::Optional methods

Added: 
    

Modified: 
    mlir/docs/DefiningDialects.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/DefiningDialects.md b/mlir/docs/DefiningDialects.md
index 6445b52cb9c6b..c043eabeacc8c 100644
--- a/mlir/docs/DefiningDialects.md
+++ b/mlir/docs/DefiningDialects.md
@@ -528,7 +528,7 @@ Type MyDialect::parseType(DialectAsmParser &parser) const {
     // Try to parse a dynamic type with 'typeTag' name.
     Type dynType;
     auto parseResult = parseOptionalDynamicType(typeTag, parser, dynType);
-    if (parseResult.hasValue()) {
+    if (parseResult.has_value()) {
         if (succeeded(parseResult.getValue()))
             return dynType;
          return Type();
@@ -628,8 +628,8 @@ Attribute MyDialect::parseAttribute(DialectAsmParser &parser,
     // Try to parse a dynamic attribute with 'attrTag' name.
     Attribute dynAttr;
     auto parseResult = parseOptionalDynamicAttr(attrTag, parser, dynAttr);
-    if (parseResult.hasValue()) {
-        if (succeeded(parseResult.getValue()))
+    if (parseResult.has_value()) {
+        if (succeeded(*parseResult))
             return dynAttr;
          return Attribute();
     }


        


More information about the Mlir-commits mailing list