DebugAbbrevWriter &AbbrevWriter,
DebugLocWriter &DebugLocWriter,
DebugRangesSectionWriter &RangesWriter,
- Optional<uint64_t> RangesBase = std::nullopt);
+ std::optional<uint64_t> RangesBase = std::nullopt);
/// Patches the binary for an object's address ranges to be updated.
/// The object can be anything that has associated address ranges via either
void updateDWARFObjectAddressRanges(
const DWARFDie DIE, uint64_t DebugRangesOffset,
SimpleBinaryPatcher &DebugInfoPatcher, DebugAbbrevWriter &AbbrevWriter,
- uint64_t LowPCToUse, Optional<uint64_t> RangesBase = std::nullopt);
+ uint64_t LowPCToUse, std::optional<uint64_t> RangesBase = std::nullopt);
std::unique_ptr<DebugBufferVector>
makeFinalLocListsSection(DebugInfoBinaryPatcher &DebugInfoPatcher,
/// Convert \p Abbrev from using a simple DW_AT_(low|high)_pc range to
/// DW_AT_ranges with optional \p RangesBase.
- void convertToRangesPatchAbbrev(const DWARFUnit &Unit,
- const DWARFAbbreviationDeclaration *Abbrev,
- DebugAbbrevWriter &AbbrevWriter,
- Optional<uint64_t> RangesBase = std::nullopt);
+ void
+ convertToRangesPatchAbbrev(const DWARFUnit &Unit,
+ const DWARFAbbreviationDeclaration *Abbrev,
+ DebugAbbrevWriter &AbbrevWriter,
+ std::optional<uint64_t> RangesBase = std::nullopt);
/// Update \p DIE that was using DW_AT_(low|high)_pc with DW_AT_ranges offset.
/// Updates to the DIE should be synced with abbreviation updates using the
/// function above.
- void
- convertToRangesPatchDebugInfo(DWARFDie DIE, uint64_t RangesSectionOffset,
- SimpleBinaryPatcher &DebugInfoPatcher,
- uint64_t LowPCToUse,
- Optional<uint64_t> RangesBase = std::nullopt);
+ void convertToRangesPatchDebugInfo(
+ DWARFDie DIE, uint64_t RangesSectionOffset,
+ SimpleBinaryPatcher &DebugInfoPatcher, uint64_t LowPCToUse,
+ std::optional<uint64_t> RangesBase = std::nullopt);
/// Helper function for creating and returning per-DWO patchers/writers.
template <class T, class Patcher>
// Check if the unit is a skeleton and we need special updates for it and
// its matching split/DWO CU.
std::optional<DWARFUnit *> SplitCU;
- Optional<uint64_t> RangesBase;
+ std::optional<uint64_t> RangesBase;
std::optional<uint64_t> DWOId = Unit->getDWOId();
StrOffstsWriter->initialize(Unit->getStringOffsetSection(),
Unit->getStringOffsetsTableContribution());
DWARFUnit &Unit, DebugInfoBinaryPatcher &DebugInfoPatcher,
DebugAbbrevWriter &AbbrevWriter, DebugLocWriter &DebugLocWriter,
DebugRangesSectionWriter &RangesSectionWriter,
- Optional<uint64_t> RangesBase) {
+ std::optional<uint64_t> RangesBase) {
// Cache debug ranges so that the offset for identical ranges could be reused.
std::map<DebugAddressRangesVector, uint64_t> CachedRanges;
void DWARFRewriter::updateDWARFObjectAddressRanges(
const DWARFDie DIE, uint64_t DebugRangesOffset,
SimpleBinaryPatcher &DebugInfoPatcher, DebugAbbrevWriter &AbbrevWriter,
- uint64_t LowPCToUse, Optional<uint64_t> RangesBase) {
+ uint64_t LowPCToUse, std::optional<uint64_t> RangesBase) {
// Some objects don't have an associated DIE and cannot be updated (such as
// compiler-generated functions).
// Exctracts an appropriate slice if input is DWP.
// Applies patches or overwrites the section.
-Optional<StringRef>
+std::optional<StringRef>
updateDebugData(DWARFContext &DWCtx, std::string &Storage,
StringRef SectionName, StringRef SectionContents,
const StringMap<KnownSectionsEntry> &KnownSections,
extractDWOTUFromDWO(Contents, TUContributionsToCU);
}
- Optional<StringRef> TOutData = updateDebugData(
+ std::optional<StringRef> TOutData = updateDebugData(
(*DWOCU)->getContext(), Storage, SectionName, Contents, KnownSections,
*Streamer, *this, CUDWOEntry, *DWOId, OutputData, RangeListssWriter);
if (!TOutData)
if (!RangeListssWriter->empty()) {
std::string Storage;
std::unique_ptr<DebugBufferVector> OutputData;
- if (Optional<StringRef> OutData = updateDebugData(
+ if (std::optional<StringRef> OutData = updateDebugData(
(*DWOCU)->getContext(), Storage, "debug_rnglists.dwo", "",
KnownSections, *Streamer, *this, CUDWOEntry, *DWOId, OutputData,
RangeListssWriter))
*Streamer, Contents, *DWOId);
}
- if (Optional<StringRef> OutData = updateDebugData(
+ if (std::optional<StringRef> OutData = updateDebugData(
(*DWOCU)->getContext(), Storage, SectionName, Contents,
KnownSections, *Streamer, *this, CUDWOEntry, *DWOId, OutputData,
RangeListssWriter))
void DWARFRewriter::convertToRangesPatchAbbrev(
const DWARFUnit &Unit, const DWARFAbbreviationDeclaration *Abbrev,
- DebugAbbrevWriter &AbbrevWriter, Optional<uint64_t> RangesBase) {
+ DebugAbbrevWriter &AbbrevWriter, std::optional<uint64_t> RangesBase) {
dwarf::Attribute RangeBaseAttribute = dwarf::DW_AT_GNU_ranges_base;
dwarf::Form RangesForm = dwarf::DW_FORM_sec_offset;
void DWARFRewriter::convertToRangesPatchDebugInfo(
DWARFDie DIE, uint64_t RangesSectionOffset,
SimpleBinaryPatcher &DebugInfoPatcher, uint64_t LowPCToUse,
- Optional<uint64_t> RangesBase) {
+ std::optional<uint64_t> RangesBase) {
std::optional<AttrInfo> LowPCVal;
std::optional<AttrInfo> HighPCVal;
getRangeAttrData(DIE, LowPCVal, HighPCVal);