[PATCH] D70709: [Dsymutil][Debuginfo][NFC] Refactor dsymutil to separate DWARF optimizing part.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 01:57:06 PST 2019


avl created this revision.
avl added reviewers: JDevlieghere, dblaikie, aprantl.
avl added projects: debug-info, LLVM.
Herald added subscribers: jfb, hiraditya, mgorny.
Herald added a reviewer: jdoerfert.

The primary goal of this refactoring is to separate DWARF optimizing part. So that it could be reused by linker or by any other client. There was a thread on llvm-dev discussing the necessity of such a refactoring:

http://lists.llvm.org/pipermail/llvm-dev/2019-September/135068.html.

The current implementation(DwarfLinker) was separated into four main pieces: 
DwarfOptimizer, AddressesMap, DwarfEmitter, DwarfLinker.

DwarfOptimizer - Implements DWARF optimization: starting from root DIEs, scans debug info, and mark dies, which refer to live sections. Creates clones for DIEs, which should be kept. Patches offsets.
AddressesMap - Evaluates relocations and represents live addresses.
DwarfEmitter - Generates .debug_info sections according to specified DIEs or tables.
DwarfLinker - Implements dsymutil functionality.

Testing: it passes "check-all" lit testing. It also passes manual testing, which checks .dSYM bundles for llvm binaries created by dsymutil(by comparing dwarf dump). If there is a better test suite for dsymutil, I would be happy to use it.


https://reviews.llvm.org/D70709

Files:
  llvm/include/llvm/CodeGen/DIE.h
  llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFOptCompileUnit.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFOptDeclContext.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFOptimizer.h
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/NonRelocatableStringpool.cpp
  llvm/lib/DebugInfo/DWARF/CMakeLists.txt
  llvm/lib/DebugInfo/DWARF/DWARFOptCompileUnit.cpp
  llvm/lib/DebugInfo/DWARF/DWARFOptDeclContext.cpp
  llvm/lib/DebugInfo/DWARF/DWARFOptimizer.cpp
  llvm/tools/dsymutil/CMakeLists.txt
  llvm/tools/dsymutil/CompileUnit.cpp
  llvm/tools/dsymutil/CompileUnit.h
  llvm/tools/dsymutil/DeclContext.cpp
  llvm/tools/dsymutil/DeclContext.h
  llvm/tools/dsymutil/DwarfLinker.cpp
  llvm/tools/dsymutil/DwarfLinker.h
  llvm/tools/dsymutil/DwarfStreamer.cpp
  llvm/tools/dsymutil/DwarfStreamer.h
  llvm/tools/dsymutil/LinkUtils.h
  llvm/tools/dsymutil/MachOUtils.cpp
  llvm/tools/dsymutil/NonRelocatableStringpool.cpp
  llvm/tools/dsymutil/NonRelocatableStringpool.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70709.230903.patch
Type: text/x-patch
Size: 301178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191126/cb424f9f/attachment-0001.bin>


More information about the llvm-commits mailing list