]> granicus.if.org Git - llvm/commit
DebugInfo: Elide lexical scopes which only contain other (inline or lexical) scopes.
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 31 Aug 2014 21:26:22 +0000 (21:26 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 31 Aug 2014 21:26:22 +0000 (21:26 +0000)
commite2cf6dc5c9193f52354aedd728a2a43ff5ebaa3b
tree033c628545401cdfcaf24bb247885ab7945eb48d
parent30392bf19168190fff7cdd2afd48a86714aa9bf4
DebugInfo: Elide lexical scopes which only contain other (inline or lexical) scopes.

DW_TAG_lexical_scopes inform debuggers about the instruction range for
which a given variable (or imported declaration/module/etc) is valid. If
the scope doesn't itself contain any such entities, it's a waste of
space and should be omitted.

We were correctly doing this for entirely empty leaves, but not for
intermediate nodes.

Reduces total (not just debug sections) .o file size for a bootstrap
-gmlt LLVM by 22% and bootstrap -gmlt clang executable by 13%. The wins
for a full -g build will be less as a % (and in absolute terms), but
should still be substantial - with some of that win being fewer
relocations, thus more substantiall reducing link times than fewer bytes
alone would have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216861 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
test/DebugInfo/PR20038.ll
test/DebugInfo/X86/concrete_out_of_line.ll
test/DebugInfo/X86/fission-ranges.ll
test/DebugInfo/missing-abstract-variable.ll