From 6aebb5d17765c1f9946d2281c9f697328799cde4 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 2 Dec 2022 07:43:18 +0000 Subject: AttributeParser: Convert Optional to std::optional --- llvm/lib/Object/ELFObjectFile.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Object/ELFObjectFile.cpp') 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 Attr = + std::optional 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 Attr = Attributes.getAttributeString(RISCVAttrs::ARCH); + std::optional 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 Attr = + std::optional 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 ArchProfileAttr = + std::optional ArchProfileAttr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch_profile); if (ArchProfileAttr && ArchProfileAttr.value() == ARMBuildAttrs::MicroControllerProfile) -- cgit v1.1