Don't emit apple accelerator tables on non-darwin targets
authorPavel Labath <labath@google.com>
Wed, 17 Jan 2018 11:52:13 +0000 (11:52 +0000)
committerPavel Labath <labath@google.com>
Wed, 17 Jan 2018 11:52:13 +0000 (11:52 +0000)
commit67530e478baefc0fcbdf3f553d2b13f765e967c8
tree8be676abf0e91ab08a235eb138079b15a07c9604
parente6269e3509348602f356b308c9be450cd34f2d55
Don't emit apple accelerator tables on non-darwin targets

Summary:
Currently -glldb turns on emission of apple tables on all targets, but
lldb is only really capable of consuming them on darwin. Furthermore,
making lldb consume these tables is not straight-forward because of the
differences in how the debug info is distributed on darwin vs. elf
targets.

The darwin debug model assumes that the debug info (along with
accelerator tables) will either remain in the .o files or it will be
linked into a dsym bundle by a linker that knows how to merge these
tables. In the elf world, all present linkers will simply concatenate
these accelerator tables into the shared object. Since the tables are
not self-terminating, this renders the tables unusable, as the debugger
cannot pry the individual tables apart anymore.

It might theoretically be possible to make the tables work with split
dwarf, as that is somewhat similar to the apple .o model, but
unfortunately right now the combination of -glldb and -gsplit-dwarf
produces broken object files.

Until these issues are resolved there is no point in emitting the apple
tables for these targets. At best, it wastes space; at worst, it breaks
compilation and prevents the user from getting other benefits of -glldb.

Reviewers: probinson, aprantl, dblaikie

Subscribers: emaste, dim, llvm-commits, JDevlieghere

Differential Revision: https://reviews.llvm.org/D41986

llvm-svn: 322633
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/test/DebugInfo/X86/accel-tables.ll [new file with mode: 0644]