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/MC/MCContext.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/MC/MCContext.cpp')
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 1c0c711..e8f0987 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -767,14 +767,13 @@ MCSectionXCOFF *MCContext::getXCOFFSection( Optional<XCOFF::CsectProperties> CsectProp, bool MultiSymbolsAllowed, const char *BeginSymName, Optional<XCOFF::DwarfSectionSubtypeFlags> DwarfSectionSubtypeFlags) { - bool IsDwarfSec = DwarfSectionSubtypeFlags.hasValue(); - assert((IsDwarfSec != CsectProp.hasValue()) && "Invalid XCOFF section!"); + bool IsDwarfSec = DwarfSectionSubtypeFlags.has_value(); + assert((IsDwarfSec != CsectProp.has_value()) && "Invalid XCOFF section!"); // Do the lookup. If we have a hit, return it. auto IterBool = XCOFFUniquingMap.insert(std::make_pair( - IsDwarfSec - ? XCOFFSectionKey(Section.str(), DwarfSectionSubtypeFlags.getValue()) - : XCOFFSectionKey(Section.str(), CsectProp->MappingClass), + IsDwarfSec ? XCOFFSectionKey(Section.str(), *DwarfSectionSubtypeFlags) + : XCOFFSectionKey(Section.str(), CsectProp->MappingClass), nullptr)); auto &Entry = *IterBool.first; if (!IterBool.second) { @@ -804,10 +803,9 @@ MCSectionXCOFF *MCContext::getXCOFFSection( // CachedName contains invalid character(s) such as '$' for an XCOFF symbol. MCSectionXCOFF *Result = nullptr; if (IsDwarfSec) - Result = new (XCOFFAllocator.Allocate()) - MCSectionXCOFF(QualName->getUnqualifiedName(), Kind, QualName, - DwarfSectionSubtypeFlags.getValue(), Begin, CachedName, - MultiSymbolsAllowed); + Result = new (XCOFFAllocator.Allocate()) MCSectionXCOFF( + QualName->getUnqualifiedName(), Kind, QualName, + *DwarfSectionSubtypeFlags, Begin, CachedName, MultiSymbolsAllowed); else Result = new (XCOFFAllocator.Allocate()) MCSectionXCOFF(QualName->getUnqualifiedName(), CsectProp->MappingClass, |