diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-25 11:55:57 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-25 11:55:57 -0700 |
commit | aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d (patch) | |
tree | d207b35cfb445636f41204bcfe51f6ca3a94a3ba /llvm/lib/Object/ELFObjectFile.cpp | |
parent | b8df4093e4d82c67a419911a46b63482043643e5 (diff) | |
download | llvm-aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.zip llvm-aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.tar.gz llvm-aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.tar.bz2 |
Don't use Optional::hasValue (NFC)
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/ELFObjectFile.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 9bac454..9ab0357 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -167,12 +167,12 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { bool isV7 = false; Optional<unsigned> Attr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch); - if (Attr.hasValue()) - isV7 = Attr.getValue() == ARMBuildAttrs::v7; + if (Attr) + isV7 = *Attr == ARMBuildAttrs::v7; Attr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch_profile); - if (Attr.hasValue()) { - switch (Attr.getValue()) { + if (Attr) { + switch (*Attr) { case ARMBuildAttrs::ApplicationProfile: Features.AddFeature("aclass"); break; @@ -190,8 +190,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { } Attr = Attributes.getAttributeValue(ARMBuildAttrs::THUMB_ISA_use); - if (Attr.hasValue()) { - switch (Attr.getValue()) { + if (Attr) { + switch (*Attr) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -205,8 +205,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { } Attr = Attributes.getAttributeValue(ARMBuildAttrs::FP_arch); - if (Attr.hasValue()) { - switch (Attr.getValue()) { + if (Attr) { + switch (*Attr) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -229,8 +229,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { } Attr = Attributes.getAttributeValue(ARMBuildAttrs::Advanced_SIMD_arch); - if (Attr.hasValue()) { - switch (Attr.getValue()) { + if (Attr) { + switch (*Attr) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -248,8 +248,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { } Attr = Attributes.getAttributeValue(ARMBuildAttrs::MVE_arch); - if (Attr.hasValue()) { - switch (Attr.getValue()) { + if (Attr) { + switch (*Attr) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -267,8 +267,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { } Attr = Attributes.getAttributeValue(ARMBuildAttrs::DIV_use); - if (Attr.hasValue()) { - switch (Attr.getValue()) { + if (Attr) { + switch (*Attr) { default: break; case ARMBuildAttrs::DisallowDIV: @@ -521,8 +521,8 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const { Optional<unsigned> Attr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch); - if (Attr.hasValue()) { - switch (Attr.getValue()) { + if (Attr) { + switch (*Attr) { case ARMBuildAttrs::v4: Triple += "v4"; break; @@ -553,8 +553,8 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const { case ARMBuildAttrs::v7: { Optional<unsigned> ArchProfileAttr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch_profile); - if (ArchProfileAttr.hasValue() && - ArchProfileAttr.getValue() == ARMBuildAttrs::MicroControllerProfile) + if (ArchProfileAttr && + *ArchProfileAttr == ARMBuildAttrs::MicroControllerProfile) Triple += "v7m"; else Triple += "v7"; |