aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-25 11:56:50 -0700
committerKazu Hirata <kazu@google.com>2022-06-25 11:56:50 -0700
commit3b7c3a654c9175f41ac871a937cbcae73dfb3c5d (patch)
tree21094939ea6c8b726c481d7b28eaf4ea27c64008 /llvm/lib/Object/ELFObjectFile.cpp
parentaa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d (diff)
downloadllvm-3b7c3a654c9175f41ac871a937cbcae73dfb3c5d.zip
llvm-3b7c3a654c9175f41ac871a937cbcae73dfb3c5d.tar.gz
llvm-3b7c3a654c9175f41ac871a937cbcae73dfb3c5d.tar.bz2
Revert "Don't use Optional::hasValue (NFC)"
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ELFObjectFile.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp
index 9ab0357..9bac454 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)
- isV7 = *Attr == ARMBuildAttrs::v7;
+ if (Attr.hasValue())
+ isV7 = Attr.getValue() == ARMBuildAttrs::v7;
Attr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch_profile);
- if (Attr) {
- switch (*Attr) {
+ if (Attr.hasValue()) {
+ switch (Attr.getValue()) {
case ARMBuildAttrs::ApplicationProfile:
Features.AddFeature("aclass");
break;
@@ -190,8 +190,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const {
}
Attr = Attributes.getAttributeValue(ARMBuildAttrs::THUMB_ISA_use);
- if (Attr) {
- switch (*Attr) {
+ if (Attr.hasValue()) {
+ switch (Attr.getValue()) {
default:
break;
case ARMBuildAttrs::Not_Allowed:
@@ -205,8 +205,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const {
}
Attr = Attributes.getAttributeValue(ARMBuildAttrs::FP_arch);
- if (Attr) {
- switch (*Attr) {
+ if (Attr.hasValue()) {
+ switch (Attr.getValue()) {
default:
break;
case ARMBuildAttrs::Not_Allowed:
@@ -229,8 +229,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const {
}
Attr = Attributes.getAttributeValue(ARMBuildAttrs::Advanced_SIMD_arch);
- if (Attr) {
- switch (*Attr) {
+ if (Attr.hasValue()) {
+ switch (Attr.getValue()) {
default:
break;
case ARMBuildAttrs::Not_Allowed:
@@ -248,8 +248,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const {
}
Attr = Attributes.getAttributeValue(ARMBuildAttrs::MVE_arch);
- if (Attr) {
- switch (*Attr) {
+ if (Attr.hasValue()) {
+ switch (Attr.getValue()) {
default:
break;
case ARMBuildAttrs::Not_Allowed:
@@ -267,8 +267,8 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const {
}
Attr = Attributes.getAttributeValue(ARMBuildAttrs::DIV_use);
- if (Attr) {
- switch (*Attr) {
+ if (Attr.hasValue()) {
+ switch (Attr.getValue()) {
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) {
- switch (*Attr) {
+ if (Attr.hasValue()) {
+ switch (Attr.getValue()) {
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 &&
- *ArchProfileAttr == ARMBuildAttrs::MicroControllerProfile)
+ if (ArchProfileAttr.hasValue() &&
+ ArchProfileAttr.getValue() == ARMBuildAttrs::MicroControllerProfile)
Triple += "v7m";
else
Triple += "v7";