diff options
author | Richard Biener <rguenther@suse.de> | 2015-09-17 09:47:43 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-09-17 09:47:43 +0000 |
commit | bf2dbec420f5c7a05af6ca3185a4ab297b80a905 (patch) | |
tree | 6e2ef835fcb80c96a6f0fdaa4402ece9839684f0 /gcc/dwarf2out.c | |
parent | e3b5d7bae1c9cc9bd1faa905c0526dce2ee90924 (diff) | |
download | gcc-bf2dbec420f5c7a05af6ca3185a4ab297b80a905.zip gcc-bf2dbec420f5c7a05af6ca3185a4ab297b80a905.tar.gz gcc-bf2dbec420f5c7a05af6ca3185a4ab297b80a905.tar.bz2 |
passes.c (rest_of_decl_compilation): Always call early_global_decl debug hook when we created a varpool node.
2015-09-17 Richard Biener <rguenther@suse.de>
* passes.c (rest_of_decl_compilation): Always call early_global_decl
debug hook when we created a varpool node.
* dwarf2out.c (dwarf2out_late_global_decl): When in LTO call
dwarf2out_early_global_decl, when not just add location or
value attributes to existing DIEs.
From-SVN: r227857
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 7d098d8..04d593b 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -21626,14 +21626,20 @@ dwarf2out_early_global_decl (tree decl) static void dwarf2out_late_global_decl (tree decl) { - /* Output any global decls we missed or fill-in any location - information we were unable to determine on the first pass. + /* We have to generate early debug late for LTO. */ + if (in_lto_p) + dwarf2out_early_global_decl (decl); - Skip over functions because they were handled by the - debug_hooks->function_decl() call in rest_of_handle_final. */ - if ((TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)) + /* Fill-in any location information we were unable to determine + on the first pass. */ + if (TREE_CODE (decl) == VAR_DECL && !POINTER_BOUNDS_P (decl)) - dwarf2out_decl (decl); + { + dw_die_ref die = lookup_decl_die (decl); + if (die) + add_location_or_const_value_attribute (die, decl, false, + DW_AT_location); + } } /* Output debug information for type decl DECL. Called from toplev.c |