Minor changes to -ftwo-level-line-tables.
commit101f03fdcb525f2b55f0b4bbe9871276a1e30874
authorccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Feb 2015 21:36:08 +0000 (24 21:36 +0000)
committerccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Feb 2015 21:36:08 +0000 (24 21:36 +0000)
tree5b5f8ffabe2ab8b415b44b722e3c63c498c987ab
parent8b07fee7a84b15c498487a5d20643531f9ee7199
Minor changes to -ftwo-level-line-tables.

This patch is for the google/gcc-4_9 branch.

Originally, -ftwo-level-line-tables would output .subprog directives
only for inlined subprograms, and not for non-inlined ones. This was
to save space, on the assumption that the subprogram name for
non-inlined subprograms is available from the symbol table, and line
info can be reconstructed using the address obtained from there.
Unfortunately, the decl_line attribute from the subprogram DIE cannot
be reconstructed reliably, so if -gline-tables-only is given, and the
subprogram DIE is not available, we have no way of getting the decl_line
attribute for non-inlined subprograms.

This patch changes -ftwo-level-line-tables to output .subprog directives
for all subprograms, unless the new -fno-two-level-all-subprogs flag is
used to revert to the old behavior (this is meant to be temporary flag
while we're still experimenting with two-level line tables).

The cost is about 7.5% additional space in -gline-tables-only output
(after compression), or about 2 percentage points in a typical binary.

This patch also clears the logicals table at the beginning of each
function, to prevent reusing a logical from a previous function (which
could happen when compiling both C1 and C2 constructors, for example).

2015-02-24  Cary Coutant  <ccoutant@google.com>

* common.opt (ftwo-level-all-subprogs): New option.
* dwarf2out.c (scan_blocks_for_inlined_calls): Add more info to
        debugging output.
(dwarf2out_begin_function): Empty logicals table at start of
        each function.
(out_logical_entry): Output subprogram directives for non-inlined
        subprograms unless -fno-two-level-all-subprogs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google@220949 138bc75d-0d04-0410-961f-82ee72b054a4
gcc-4_9/gcc/common.opt
gcc-4_9/gcc/dwarf2out.c