* [debug-early] avoid unnecessary dwarf passes
@ 2015-03-24 17:27 Aldy Hernandez
0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2015-03-24 17:27 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
I've been trying to squash DIEs that get generated too late, and here
are some minor fixes.
First, I'm now caching CONST_DECL DIEs. No sense recreating them in
late debug.
Second, I've limited gen_generic_params_dies() to early dwarf. I don't
think we get any additional location info or anything later.
Last, and similarly as above, imported modules shouldn't need to be
generated in late debug at all. I don't think they were, but no sense
going through them as part of process_scope_var in late debug.
Committed to branch.
Aldy
[-- Attachment #2: curr --]
[-- Type: text/plain, Size: 1736 bytes --]
commit ae58778141d336360ea4a7cb7238896eebbe797f
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Mar 24 10:17:38 2015 -0700
Cache CONST_DECL dies.
Avoid unnecessary dwarf passes.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 044869d..48e2eed 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -19080,7 +19080,8 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
/* XXX */
if (!lookup_decl_die (decl))
equate_decl_number_to_die (decl, subr_die);
- gen_generic_params_dies (decl);
+ if (early_dwarf_dumping)
+ gen_generic_params_dies (decl);
}
/* Now output descriptions of the arguments for this function. This gets
@@ -19713,7 +19714,12 @@ gen_const_die (tree decl, dw_die_ref context_die)
dw_die_ref const_die;
tree type = TREE_TYPE (decl);
+ const_die = lookup_decl_die (decl);
+ if (const_die)
+ return;
+
const_die = new_die (DW_TAG_constant, context_die, decl);
+ equate_decl_number_to_die (decl, const_die);
add_name_and_src_coords_attributes (const_die, decl);
add_type_attribute (const_die, type, TYPE_QUAL_CONST, context_die);
if (TREE_PUBLIC (decl))
@@ -21018,8 +21024,11 @@ process_scope_var (tree stmt, tree decl, tree origin, dw_die_ref context_die)
if (die != NULL && die->die_parent == NULL)
add_child_die (context_die, die);
else if (TREE_CODE (decl_or_origin) == IMPORTED_DECL)
- dwarf2out_imported_module_or_decl_1 (decl_or_origin, DECL_NAME (decl_or_origin),
- stmt, context_die);
+ {
+ if (early_dwarf_dumping)
+ dwarf2out_imported_module_or_decl_1 (decl_or_origin, DECL_NAME (decl_or_origin),
+ stmt, context_die);
+ }
else
gen_decl_die (decl, origin, context_die);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-24 17:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 17:27 [debug-early] avoid unnecessary dwarf passes Aldy Hernandez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).