Omit DW_TAG_subprograms for subprograms without inlined subroutines when producing...
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 19 Sep 2014 17:03:16 +0000 (17:03 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 19 Sep 2014 17:03:16 +0000 (17:03 +0000)
commit9e4e3d057f38e30d54a6a8e6a409d2c90171c8cd
tree751e088dc312344cff5a3e6f2ea0630b3ee3959d
parentf5938eeeb32128cb1f85b118cc929ff2ae1af71f
Omit DW_TAG_subprograms for subprograms without inlined subroutines when producing -gmlt data

To reduce the size of -gmlt data, skip the subprograms without any
inlined subroutines. Since we've now got the ability to make these
determinations in the backend (funnily enough - we added the flag so we
wouldn't produce ranges under -gmlt, but with this change we use the
flag, but go back to producing ranges under -gmlt).

Instead, just produce CU ranges to inform the consumer which parts of
the code are described by this CU's line table. Tools could inspect the
line table directly to compute the range, but the CU ranges only seem to
be about 0.5% of object/executable size, so I'm not too worried about
teaching llvm-symbolizer that trick just yet - it's certainly a possible
piece of future work.

Update an llvm-symbolizer test just to demonstrate that this schema is
acceptable there (if it wasn't, the compiler-rt tests would catch this,
but good to have an in-llvm-tree test for llvm-symbolizer's behavior
here)

Building the clang binary with -gmlt with this patch reduces the total
size of object files by 5.1% (5.56% without ranges) without compression
and the executable by 4.37% (4.75% without ranges).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218129 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
test/DebugInfo/Inputs/dwarfdump-inl-test.elf-x86-64
test/DebugInfo/gmlt.ll
test/DebugInfo/llvm-symbolizer.test