aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-12-12 22:41:31 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-12-12 21:41:31 +0000
commitb8e99d033082f69bc672ada056cb9676a8b6cf64 (patch)
tree7e6fb11308092ab2f1f3c5ae6c1b8ddc859e0ae8 /gcc/tree.c
parent425112c8e1a1c0025320c079e7a5d94dcda5ee20 (diff)
downloadgcc-b8e99d033082f69bc672ada056cb9676a8b6cf64.zip
gcc-b8e99d033082f69bc672ada056cb9676a8b6cf64.tar.gz
gcc-b8e99d033082f69bc672ada056cb9676a8b6cf64.tar.bz2
tree.c (free_lang_data_in_type, [...]): Also free unnecesary type decls.
* tree.c (free_lang_data_in_type, find_decls_types_r): Also free unnecesary type decls. * tree.h (is_redundant_typedef): Declare. * dwarf2out.c (is_redundant_typedef): Export; booleanize From-SVN: r231588
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index de67c4f..21c5fe1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5191,7 +5191,10 @@ free_lang_data_in_type (tree type)
while (member)
{
if (TREE_CODE (member) == FIELD_DECL
- || TREE_CODE (member) == TYPE_DECL)
+ || (TREE_CODE (member) == TYPE_DECL
+ && !DECL_IGNORED_P (member)
+ && debug_info_level > DINFO_LEVEL_TERSE
+ && !is_redundant_typedef (member)))
{
if (prev)
TREE_CHAIN (prev) = member;
@@ -5216,7 +5219,7 @@ free_lang_data_in_type (tree type)
/* Remove TYPE_METHODS list. While it would be nice to keep it
to enable ODR warnings about different method lists, doing so
seems to impractically increase size of LTO data streamed.
- Keep the infrmation if TYPE_METHODS was non-NULL. This is used
+ Keep the information if TYPE_METHODS was non-NULL. This is used
by function.c and pretty printers. */
if (TYPE_METHODS (type))
TYPE_METHODS (type) = error_mark_node;
@@ -5666,7 +5669,10 @@ find_decls_types_r (tree *tp, int *ws, void *data)
while (tem)
{
if (TREE_CODE (tem) == FIELD_DECL
- || TREE_CODE (tem) == TYPE_DECL)
+ || (TREE_CODE (tem) == TYPE_DECL
+ && !DECL_IGNORED_P (tem)
+ && debug_info_level > DINFO_LEVEL_TERSE
+ && !is_redundant_typedef (tem)))
fld_worklist_push (tem, fld);
tem = TREE_CHAIN (tem);
}