Skip to content

Commit d283627

Browse files
authored
[BOLT][DWARF][NFC] Update Die to not use std::optional (llvm#97844)
Updates initialization to remove unnecessary use of std::optional.
1 parent f137be3 commit d283627

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,14 +1635,13 @@ void DWARFRewriter::finalizeCompileUnits(DIEBuilder &DIEBlder,
16351635
"RangesWriter does not exist for DWOId");
16361636
std::unique_ptr<DebugRangesSectionWriter> &LegacyRangesWriter =
16371637
RangesWriterIterator->second;
1638-
std::optional<DIE *> Die = LegacyRangesWriter->getDie();
1639-
if (!Die || !Die.value())
1638+
DIE *Die = LegacyRangesWriter->getDie();
1639+
if (!Die)
16401640
continue;
1641-
DIEValue DvalGNUBase =
1642-
Die.value()->findAttribute(dwarf::DW_AT_GNU_ranges_base);
1641+
DIEValue DvalGNUBase = Die->findAttribute(dwarf::DW_AT_GNU_ranges_base);
16431642
assert(DvalGNUBase && "GNU_ranges_base attribute does not exist for DWOId");
16441643
DIEBlder.replaceValue(
1645-
Die.value(), dwarf::DW_AT_GNU_ranges_base, DvalGNUBase.getForm(),
1644+
Die, dwarf::DW_AT_GNU_ranges_base, DvalGNUBase.getForm(),
16461645
DIEInteger(LegacyRangesSectionWriter->getSectionOffset()));
16471646
std::unique_ptr<DebugBufferVector> RangesWritersContents =
16481647
LegacyRangesWriter->releaseBuffer();

0 commit comments

Comments
 (0)