diff --git a/bolt/include/bolt/Rewrite/DWARFRewriter.h b/bolt/include/bolt/Rewrite/DWARFRewriter.h --- a/bolt/include/bolt/Rewrite/DWARFRewriter.h +++ b/bolt/include/bolt/Rewrite/DWARFRewriter.h @@ -147,11 +147,6 @@ 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 --- a/bolt/lib/Rewrite/DWARFRewriter.cpp +++ b/bolt/lib/Rewrite/DWARFRewriter.cpp @@ -1364,47 +1364,6 @@ } // 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) {