From 210bb04e23429fe9f79c4c83c7df450a0c3250c5 Mon Sep 17 00:00:00 2001 From: Alexander Yermolovich Date: Tue, 22 Feb 2022 13:26:38 -0800 Subject: [BOLT][DWARF] Remove patchLowHigh unused function. Cleanup after removing caching mechanims for ranges/abbrevs. Reviewed By: rafauler, yota9 Differential Revision: https://reviews.llvm.org/D120174 --- bolt/include/bolt/Rewrite/DWARFRewriter.h | 5 ---- bolt/lib/Rewrite/DWARFRewriter.cpp | 41 ------------------------------- 2 files changed, 46 deletions(-) (limited to 'bolt') diff --git a/bolt/include/bolt/Rewrite/DWARFRewriter.h b/bolt/include/bolt/Rewrite/DWARFRewriter.h index 2b0888c2329d..74e10b146c53 100644 --- a/bolt/include/bolt/Rewrite/DWARFRewriter.h +++ b/bolt/include/bolt/Rewrite/DWARFRewriter.h @@ -147,11 +147,6 @@ class DWARFRewriter { SimpleBinaryPatcher &DebugInfoPatcher, Optional RangesBase = None); - /// Patch DW_AT_(low|high)_pc values for the \p DIE based on \p Range. - void patchLowHigh(DWARFDie DIE, DebugAddressRange Range, - SimpleBinaryPatcher &DebugInfoPatcher, - Optional DWOId); - /// Helper function for creating and returning per-DWO patchers/writers. template Patcher *getBinaryDWOPatcherHelper(T &BinaryPatchers, uint64_t DwoId) { diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp index 40d43bf858f8..df4e3d2ecf73 100644 --- a/bolt/lib/Rewrite/DWARFRewriter.cpp +++ b/bolt/lib/Rewrite/DWARFRewriter.cpp @@ -1364,47 +1364,6 @@ void getRangeAttrData(DWARFDie DIE, Optional &LowPCVal, } // namespace -void DWARFRewriter::patchLowHigh(DWARFDie DIE, DebugAddressRange Range, - SimpleBinaryPatcher &DebugInfoPatcher, - Optional DWOId) { - Optional LowPCVal = None; - Optional HighPCVal = None; - getRangeAttrData(DIE, LowPCVal, HighPCVal); - uint64_t LowPCOffset = LowPCVal->Offset; - uint64_t HighPCOffset = HighPCVal->Offset; - auto *TempDebugPatcher = &DebugInfoPatcher; - if (LowPCVal->V.getForm() == dwarf::DW_FORM_GNU_addr_index) { - uint32_t AddressIndex = - AddrWriter->getIndexFromAddress(Range.LowPC, *DWOId); - TempDebugPatcher = getBinaryDWODebugInfoPatcher(*DWOId); - TempDebugPatcher->addUDataPatch(LowPCOffset, AddressIndex, LowPCVal->Size); - // 2.17.2 - // If the value of the DW_AT_high_pc is of class address, it is the - // relocated address of the first location past the last instruction - // associated with the entity; if it is of class constant, the value is - // an unsigned integer offset which when added to the low PC gives the - // address of the first location past the last instruction associated - // with the entity. - if (!HighPCVal->V.isFormClass(DWARFFormValue::FC_Constant)) { - AddressIndex = AddrWriter->getIndexFromAddress(Range.HighPC, *DWOId); - TempDebugPatcher->addUDataPatch(HighPCOffset, AddressIndex, - HighPCVal->Size); - } - } else { - TempDebugPatcher->addLE64Patch(LowPCOffset, Range.LowPC); - } - - uint64_t HighPC = Range.HighPC; - // The DW_FORM_data* is delta between high and low pc - if (HighPCVal->V.getForm() != dwarf::Form::DW_FORM_addr) - HighPC -= Range.LowPC; - - if (isHighPcFormEightBytes(HighPCVal->V.getForm())) - TempDebugPatcher->addLE64Patch(HighPCOffset, HighPC); - else - TempDebugPatcher->addLE32Patch(HighPCOffset, HighPC); -} - void DWARFRewriter::convertToRangesPatchAbbrev( const DWARFUnit &Unit, const DWARFAbbreviationDeclaration *Abbrev, DebugAbbrevWriter &AbbrevWriter, Optional RangesBase) { -- cgit v1.2.3