[PATCH] D120174: [BOLT][DWARF] Remove patchLowHigh unused function.

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 13:28:39 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG210bb04e2342: [BOLT][DWARF] Remove patchLowHigh unused function. (authored by ayermolo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120174/new/

https://reviews.llvm.org/D120174

Files:
  bolt/include/bolt/Rewrite/DWARFRewriter.h
  bolt/lib/Rewrite/DWARFRewriter.cpp


Index: bolt/lib/Rewrite/DWARFRewriter.cpp
===================================================================
--- bolt/lib/Rewrite/DWARFRewriter.cpp
+++ bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -1364,47 +1364,6 @@
 
 } // namespace
 
-void DWARFRewriter::patchLowHigh(DWARFDie DIE, DebugAddressRange Range,
-                                 SimpleBinaryPatcher &DebugInfoPatcher,
-                                 Optional<uint64_t> DWOId) {
-  Optional<AttrInfo> LowPCVal = None;
-  Optional<AttrInfo> 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<uint64_t> RangesBase) {
Index: bolt/include/bolt/Rewrite/DWARFRewriter.h
===================================================================
--- bolt/include/bolt/Rewrite/DWARFRewriter.h
+++ bolt/include/bolt/Rewrite/DWARFRewriter.h
@@ -147,11 +147,6 @@
                                      SimpleBinaryPatcher &DebugInfoPatcher,
                                      Optional<uint64_t> 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<uint64_t> DWOId);
-
   /// Helper function for creating and returning per-DWO patchers/writers.
   template <class T, class Patcher>
   Patcher *getBinaryDWOPatcherHelper(T &BinaryPatchers, uint64_t DwoId) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120174.410632.patch
Type: text/x-patch
Size: 3152 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220222/da88b328/attachment.bin>


More information about the llvm-commits mailing list