diff options
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, |