[PATCH] D49137: [dsymutil] Implement DWARF5 accelerator tables.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 11:29:52 PDT 2018


JDevlieghere updated this revision to Diff 155927.
JDevlieghere added a comment.

Address code review feedback @friss.

The problem determining the accelerator kind in the default case is that registerModuleReference potentially imports new compile units, which might affect the dwarf version and accelerator table kind. If this is the case, we clone all compile units which means adding entries to the accelerator table. This is problematic because the next such module might affect the decision of which kind of accelerator table to use. I think there's several solutions to this problem:

1. Ignore this and don't let referenced modules affect the decision.
2. Don't clone the CUs at that point would remove the need to populate the tables. This would require restructuring quite a bit of code, and also means keeping unnecessary stuff in memory longer. (e.g. it's CU list, DwarfContext, etc)
3. Have a generic data structure that we can later convert in either an Apple or Dwarf accelerator table. This would require copying info from one struct to another, and we'd need a way to differentiate between what goes where. For the Apple case information will end up in separate tables, while for DWARF there's only one. We also designed the accelerator tables in such a way that they were configurable in their type, by going through another type we'd essentially nullify that effort.
4. Populate both tables as long as we're in limbo about the kind. This means we're duplicating information in memory, but **only** for modules. As soon as we know the kind we clear the other tables and reclaim the memory.

In this patch I've implemented (4) because it was relatively straightforward and only affects CUs imported by modules.


https://reviews.llvm.org/D49137

Files:
  llvm/include/llvm/CodeGen/AccelTable.h
  llvm/test/tools/dsymutil/X86/accelerator.test
  llvm/test/tools/dsymutil/cmdline.test
  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/dsymutil.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49137.155927.patch
Type: text/x-patch
Size: 18415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180717/57aa89b9/attachment.bin>


More information about the llvm-commits mailing list