[CSKY] Fix warnings on the use of deprecated methods. NFC.
authorMichael Liao <michael.hliao@gmail.com>
Fri, 26 Aug 2022 14:21:52 +0000 (10:21 -0400)
committerMichael Liao <michael.hliao@gmail.com>
Fri, 26 Aug 2022 14:23:16 +0000 (10:23 -0400)
llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp

index 63a6047..60eb552 100644 (file)
@@ -1639,11 +1639,11 @@ bool CSKYAsmParser::parseDirectiveAttribute() {
     StringRef Name = Parser.getTok().getIdentifier();
     Optional<unsigned> Ret =
         ELFAttrs::attrTypeFromString(Name, CSKYAttrs::getCSKYAttributeTags());
-    if (!Ret.hasValue()) {
+    if (!Ret) {
       Error(TagLoc, "attribute name not recognised: " + Name);
       return false;
     }
-    Tag = Ret.getValue();
+    Tag = *Ret;
     Parser.Lex();
   } else {
     const MCExpr *AttrExpr;