mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 22:17:23 +08:00
[BOLT][DWARF][NFC] Update Die to not use std::optional (#97844)
Updates initialization to remove unnecessary use of std::optional.
This commit is contained in:
@@ -1635,14 +1635,13 @@ void DWARFRewriter::finalizeCompileUnits(DIEBuilder &DIEBlder,
|
||||
"RangesWriter does not exist for DWOId");
|
||||
std::unique_ptr<DebugRangesSectionWriter> &LegacyRangesWriter =
|
||||
RangesWriterIterator->second;
|
||||
std::optional<DIE *> Die = LegacyRangesWriter->getDie();
|
||||
if (!Die || !Die.value())
|
||||
DIE *Die = LegacyRangesWriter->getDie();
|
||||
if (!Die)
|
||||
continue;
|
||||
DIEValue DvalGNUBase =
|
||||
Die.value()->findAttribute(dwarf::DW_AT_GNU_ranges_base);
|
||||
DIEValue DvalGNUBase = Die->findAttribute(dwarf::DW_AT_GNU_ranges_base);
|
||||
assert(DvalGNUBase && "GNU_ranges_base attribute does not exist for DWOId");
|
||||
DIEBlder.replaceValue(
|
||||
Die.value(), dwarf::DW_AT_GNU_ranges_base, DvalGNUBase.getForm(),
|
||||
Die, dwarf::DW_AT_GNU_ranges_base, DvalGNUBase.getForm(),
|
||||
DIEInteger(LegacyRangesSectionWriter->getSectionOffset()));
|
||||
std::unique_ptr<DebugBufferVector> RangesWritersContents =
|
||||
LegacyRangesWriter->releaseBuffer();
|
||||
|
||||
Reference in New Issue
Block a user