[PATCH] D157357: [BOLT][DWARF][NFC] Remove addIndexAddress

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 20:33:34 PDT 2023


ayermolo created this revision.
Herald added subscribers: treapster, hoy, modimo, wenlei, arphaman.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
ayermolo requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

Removed unused API DebugAddrWriter::addIndexAddress.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157357

Files:
  bolt/include/bolt/Core/DebugData.h
  bolt/lib/Core/DebugData.cpp


Index: bolt/lib/Core/DebugData.cpp
===================================================================
--- bolt/lib/Core/DebugData.cpp
+++ bolt/lib/Core/DebugData.cpp
@@ -414,25 +414,6 @@
   return Entry->second;
 }
 
-// Case1) Address is not in map insert in to AddresToIndex and IndexToAddres
-// Case2) Address is in the map but Index is higher or equal. Need to update
-// IndexToAddrss. Case3) Address is in the map but Index is lower. Need to
-// update AddressToIndex and IndexToAddress
-void DebugAddrWriter::addIndexAddress(uint64_t Address, uint32_t Index,
-                                      DWARFUnit &CU) {
-  std::lock_guard<std::mutex> Lock(WriterMutex);
-  const uint64_t CUID = getCUID(CU);
-  AddressForDWOCU &Map = AddressMaps[CUID];
-  auto Entry = Map.find(Address);
-  if (Entry != Map.end()) {
-    if (Entry->second > Index)
-      Map.updateAddressToIndex(Address, Index);
-    Map.updateIndexToAddrss(Address, Index);
-  } else {
-    Map.insert(Address, Index);
-  }
-}
-
 static void updateAddressBase(DIEBuilder &DIEBlder, DebugAddrWriter &AddrWriter,
                               DWARFUnit &CU, const uint64_t Offset) {
   DIE *Die = DIEBlder.getUnitDIEbyUnit(CU);
Index: bolt/include/bolt/Core/DebugData.h
===================================================================
--- bolt/include/bolt/Core/DebugData.h
+++ bolt/include/bolt/Core/DebugData.h
@@ -313,9 +313,6 @@
   /// Adds Address to map.
   uint32_t getIndexFromAddress(uint64_t Address, DWARFUnit &CU);
 
-  /// Adds {\p Address, \p Index} to \p CU.
-  void addIndexAddress(uint64_t Address, uint32_t Index, DWARFUnit &CU);
-
   /// Write out entries in to .debug_addr section for CUs.
   virtual void update(DIEBuilder &DIEBlder, DWARFUnit &CUs);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157357.548049.patch
Type: text/x-patch
Size: 1750 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230808/dededd67/attachment.bin>


More information about the llvm-commits mailing list