[llvm] e84784e - [CSKY] Fix warnings on the use of deprecated methods. NFC.

Michael Liao via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 07:28:21 PDT 2022


Author: Michael Liao
Date: 2022-08-26T10:23:16-04:00
New Revision: e84784e4ae808fbe7f6680f3afb2786f46bbacb3

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

LOG: [CSKY] Fix warnings on the use of deprecated methods. NFC.

Added: 
    

Modified: 
    llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp b/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
index 63a60473d664d..60eb552039bbc 100644
--- a/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
+++ b/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
@@ -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;


        


More information about the llvm-commits mailing list