Skip to content

Commit 210bb04

Browse files
committed
[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
1 parent 746bd89 commit 210bb04

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

bolt/include/bolt/Rewrite/DWARFRewriter.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,6 @@ class DWARFRewriter {
147147
SimpleBinaryPatcher &DebugInfoPatcher,
148148
Optional<uint64_t> RangesBase = None);
149149

150-
/// Patch DW_AT_(low|high)_pc values for the \p DIE based on \p Range.
151-
void patchLowHigh(DWARFDie DIE, DebugAddressRange Range,
152-
SimpleBinaryPatcher &DebugInfoPatcher,
153-
Optional<uint64_t> DWOId);
154-
155150
/// Helper function for creating and returning per-DWO patchers/writers.
156151
template <class T, class Patcher>
157152
Patcher *getBinaryDWOPatcherHelper(T &BinaryPatchers, uint64_t DwoId) {

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,47 +1364,6 @@ void getRangeAttrData(DWARFDie DIE, Optional<AttrInfo> &LowPCVal,
13641364

13651365
} // namespace
13661366

1367-
void DWARFRewriter::patchLowHigh(DWARFDie DIE, DebugAddressRange Range,
1368-
SimpleBinaryPatcher &DebugInfoPatcher,
1369-
Optional<uint64_t> DWOId) {
1370-
Optional<AttrInfo> LowPCVal = None;
1371-
Optional<AttrInfo> HighPCVal = None;
1372-
getRangeAttrData(DIE, LowPCVal, HighPCVal);
1373-
uint64_t LowPCOffset = LowPCVal->Offset;
1374-
uint64_t HighPCOffset = HighPCVal->Offset;
1375-
auto *TempDebugPatcher = &DebugInfoPatcher;
1376-
if (LowPCVal->V.getForm() == dwarf::DW_FORM_GNU_addr_index) {
1377-
uint32_t AddressIndex =
1378-
AddrWriter->getIndexFromAddress(Range.LowPC, *DWOId);
1379-
TempDebugPatcher = getBinaryDWODebugInfoPatcher(*DWOId);
1380-
TempDebugPatcher->addUDataPatch(LowPCOffset, AddressIndex, LowPCVal->Size);
1381-
// 2.17.2
1382-
// If the value of the DW_AT_high_pc is of class address, it is the
1383-
// relocated address of the first location past the last instruction
1384-
// associated with the entity; if it is of class constant, the value is
1385-
// an unsigned integer offset which when added to the low PC gives the
1386-
// address of the first location past the last instruction associated
1387-
// with the entity.
1388-
if (!HighPCVal->V.isFormClass(DWARFFormValue::FC_Constant)) {
1389-
AddressIndex = AddrWriter->getIndexFromAddress(Range.HighPC, *DWOId);
1390-
TempDebugPatcher->addUDataPatch(HighPCOffset, AddressIndex,
1391-
HighPCVal->Size);
1392-
}
1393-
} else {
1394-
TempDebugPatcher->addLE64Patch(LowPCOffset, Range.LowPC);
1395-
}
1396-
1397-
uint64_t HighPC = Range.HighPC;
1398-
// The DW_FORM_data* is delta between high and low pc
1399-
if (HighPCVal->V.getForm() != dwarf::Form::DW_FORM_addr)
1400-
HighPC -= Range.LowPC;
1401-
1402-
if (isHighPcFormEightBytes(HighPCVal->V.getForm()))
1403-
TempDebugPatcher->addLE64Patch(HighPCOffset, HighPC);
1404-
else
1405-
TempDebugPatcher->addLE32Patch(HighPCOffset, HighPC);
1406-
}
1407-
14081367
void DWARFRewriter::convertToRangesPatchAbbrev(
14091368
const DWARFUnit &Unit, const DWARFAbbreviationDeclaration *Abbrev,
14101369
DebugAbbrevWriter &AbbrevWriter, Optional<uint64_t> RangesBase) {

0 commit comments

Comments
 (0)