aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-02 07:43:18 +0000
committerFangrui Song <i@maskray.me>2022-12-02 07:43:18 +0000
commit6aebb5d17765c1f9946d2281c9f697328799cde4 (patch)
treebbf87b0eccb8c8d412da8d4baf4b1a3741b9e1e9 /llvm/lib/Object/ELFObjectFile.cpp
parent4763e877f7202b2ff70d01370b0a0caffd4f539b (diff)
downloadllvm-6aebb5d17765c1f9946d2281c9f697328799cde4.zip
llvm-6aebb5d17765c1f9946d2281c9f697328799cde4.tar.gz
llvm-6aebb5d17765c1f9946d2281c9f697328799cde4.tar.bz2
AttributeParser: Convert Optional to std::optional
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ELFObjectFile.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp
index 5726299..31f0090 100644
--- a/llvm/lib/Object/ELFObjectFile.cpp
+++ b/llvm/lib/Object/ELFObjectFile.cpp
@@ -166,7 +166,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const {
// both ARMv7-M and R have to support thumb hardware div
bool isV7 = false;
- Optional<unsigned> Attr =
+ std::optional<unsigned> Attr =
Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch);
if (Attr)
isV7 = Attr.value() == ARMBuildAttrs::v7;
@@ -303,7 +303,8 @@ SubtargetFeatures ELFObjectFileBase::getRISCVFeatures() const {
return Features; // Keep "c" feature if there is one in PlatformFlags.
}
- Optional<StringRef> Attr = Attributes.getAttributeString(RISCVAttrs::ARCH);
+ std::optional<StringRef> Attr =
+ Attributes.getAttributeString(RISCVAttrs::ARCH);
if (Attr) {
// The Arch pattern is [rv32|rv64][i|e]version(_[m|a|f|d|c]version)*
// Version string pattern is (major)p(minor). Major and minor are optional.
@@ -542,7 +543,7 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const {
else
Triple = "arm";
- Optional<unsigned> Attr =
+ std::optional<unsigned> Attr =
Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch);
if (Attr) {
switch (Attr.value()) {
@@ -574,7 +575,7 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const {
Triple += "v6k";
break;
case ARMBuildAttrs::v7: {
- Optional<unsigned> ArchProfileAttr =
+ std::optional<unsigned> ArchProfileAttr =
Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch_profile);
if (ArchProfileAttr &&
ArchProfileAttr.value() == ARMBuildAttrs::MicroControllerProfile)