diff options
author | David Blaikie <dblaikie@gmail.com> | 2018-11-13 20:08:10 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2018-11-13 20:08:10 +0000 |
commit | bb279116f29617467a176f065c8ca4e84174e7f7 (patch) | |
tree | 5faf1969b2e9d4b43ddf8b30d5abd0ee08760897 /llvm/lib/IR/DIBuilder.cpp | |
parent | 2af3416618e6d521eade365eecf5ab353cdf5b6c (diff) | |
download | bcm5719-llvm-bb279116f29617467a176f065c8ca4e84174e7f7.tar.gz bcm5719-llvm-bb279116f29617467a176f065c8ca4e84174e7f7.zip |
DebugInfo: Add a CU metadata attribute for use of DWARF ranges base address specifiers
Summary:
Ranges base address specifiers can save a lot of object size in
relocation records especially in optimized builds.
For an optimized self-host build of Clang with split DWARF and debug
info compression in object files, but uncompressed debug info in the
executable, this change produces about 18% smaller object files and 6%
larger executable.
While it would've been nice to turn this on by default, gold's 32 bit
gdb-index support crashes on this input & I don't think there's any
perfect heuristic to implement solely in LLVM that would suffice - so
we'll need a flag one way or another (also possible people might want to
aggressively optimized for executable size that contains debug info
(even with compression this would still come at some cost to executable
size)) - so let's plumb it through.
Differential Revision: https://reviews.llvm.org/D54242
llvm-svn: 346788
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index df3578ea87f..0254312329a 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -140,7 +140,7 @@ DICompileUnit *DIBuilder::createCompileUnit( StringRef Flags, unsigned RunTimeVer, StringRef SplitName, DICompileUnit::DebugEmissionKind Kind, uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling, - DICompileUnit::DebugNameTableKind NameTableKind) { + DICompileUnit::DebugNameTableKind NameTableKind, bool RangesBaseAddress) { assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) || (Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) && @@ -150,7 +150,8 @@ DICompileUnit *DIBuilder::createCompileUnit( CUNode = DICompileUnit::getDistinct( VMContext, Lang, File, Producer, isOptimized, Flags, RunTimeVer, SplitName, Kind, nullptr, nullptr, nullptr, nullptr, nullptr, DWOId, - SplitDebugInlining, DebugInfoForProfiling, NameTableKind); + SplitDebugInlining, DebugInfoForProfiling, NameTableKind, + RangesBaseAddress); // Create a named metadata so that it is easier to find cu in a module. NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu"); |