[PATCH] D49493: [DebugInfo] Reduce debug_str_offsets section size

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 08:23:39 PDT 2018


labath updated this revision to Diff 156795.
labath added a comment.

- rebase the patch on top of https://reviews.llvm.org/D49670
- add a unittest-style test of the scenario Paul wanted (so far I've kept both tests, let me know which one looks better)
- fix a bug in dsymutil which was exposed when turing assertions on. The issue was that dsymutil is using the same string pool (it seems to me) both for emitting strings into the debug info, and as a general string pool for interning strings. It tells the difference by marking the symbol's index as -1, which is the same value I used for non-indexed strings. This caused an assertion to fire when we were sorting DwarfStringPoolEntryRef for emission. Fortunately, the fix is simple -- instead of sorting the entries which will never be emitted, I just never put them in the emission list in the first place (NonrelocatableStringPool::getEntries). To make it extra explicit that the list returned by getEntries does not contain all strings in the pool, I rename the function to getEntriesForEmission.
- fix a bug where we would needlessly emit a .debug_str_offsets header even though the string pool contained zero indexed strings.


Repository:
  rL LLVM

https://reviews.llvm.org/D49493

Files:
  include/llvm/CodeGen/DwarfStringPoolEntry.h
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
  lib/CodeGen/AsmPrinter/DwarfStringPool.h
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  test/DebugInfo/X86/string-offsets-table-order.ll
  test/DebugInfo/X86/string-offsets-table.ll
  tools/dsymutil/DwarfStreamer.cpp
  tools/dsymutil/MachOUtils.cpp
  tools/dsymutil/NonRelocatableStringpool.cpp
  tools/dsymutil/NonRelocatableStringpool.h
  unittests/CodeGen/DIEHashTest.cpp
  unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
  unittests/DebugInfo/DWARF/DwarfGenerator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49493.156795.patch
Type: text/x-patch
Size: 25214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180723/2f344a59/attachment.bin>


More information about the llvm-commits mailing list