diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c30b09b1061..370d0b4d1b1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-04-21 Richard Biener + + * tree.h (build_qualified_type): Annotate with CXX_MEM_STAT_INFO. + (build_distinct_type_copy): Likewise. + (build_variant_type_copy): Likewise. + * tree.c (build_qualified_type): Pass down mem-stat info. + (build_distinct_type_copy): Likewise. + (build_variant_type_copy): Likewise. + 2017-04-21 Richard Biener PR tree-optimization/80237 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5e14c411b71..dad7a0a2520 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2017-04-21 Richard Biener + + * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO. + (copy_type): Likewise. + * lex.c (copy_decl): Pass down mem-stat info. + (copy_type): Likewise. + 2017-04-20 Jonathan Wakely PR c++/80473 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 67dfea2c65b..1d53e69b241 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -6081,8 +6081,8 @@ extern tree unqualified_fn_lookup_error (cp_expr); extern tree build_lang_decl (enum tree_code, tree, tree); extern tree build_lang_decl_loc (location_t, enum tree_code, tree, tree); extern void retrofit_lang_decl (tree); -extern tree copy_decl (tree); -extern tree copy_type (tree); +extern tree copy_decl (tree CXX_MEM_STAT_INFO); +extern tree copy_type (tree CXX_MEM_STAT_INFO); extern tree cxx_make_type (enum tree_code); extern tree make_class_type (enum tree_code); extern bool cxx_init (void); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index ad6318656ad..0f8a269dce4 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -607,11 +607,11 @@ cxx_dup_lang_specific_decl (tree node) /* Copy DECL, including any language-specific parts. */ tree -copy_decl (tree decl) +copy_decl (tree decl MEM_STAT_DECL) { tree copy; - copy = copy_node (decl); + copy = copy_node_stat (decl PASS_MEM_STAT); cxx_dup_lang_specific_decl (copy); return copy; } @@ -645,11 +645,11 @@ copy_lang_type (tree node) /* Copy TYPE, including any language-specific parts. */ tree -copy_type (tree type) +copy_type (tree type MEM_STAT_DECL) { tree copy; - copy = copy_node (type); + copy = copy_node_stat (type PASS_MEM_STAT); copy_lang_type (copy); return copy; } diff --git a/gcc/tree.c b/gcc/tree.c index 72dbba4daad..f6516d15ff0 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -6622,7 +6622,7 @@ get_qualified_type (tree type, int type_quals) exist. This function never returns NULL_TREE. */ tree -build_qualified_type (tree type, int type_quals) +build_qualified_type (tree type, int type_quals MEM_STAT_DECL) { tree t; @@ -6632,7 +6632,7 @@ build_qualified_type (tree type, int type_quals) /* If not, build it. */ if (!t) { - t = build_variant_type_copy (type); + t = build_variant_type_copy (type PASS_MEM_STAT); set_type_quals (t, type_quals); if (((type_quals & TYPE_QUAL_ATOMIC) == TYPE_QUAL_ATOMIC)) @@ -6695,9 +6695,9 @@ build_aligned_type (tree type, unsigned int align) TYPE_CANONICAL points to itself. */ tree -build_distinct_type_copy (tree type) +build_distinct_type_copy (tree type MEM_STAT_DECL) { - tree t = copy_node (type); + tree t = copy_node_stat (type PASS_MEM_STAT); TYPE_POINTER_TO (t) = 0; TYPE_REFERENCE_TO (t) = 0; @@ -6733,11 +6733,11 @@ build_distinct_type_copy (tree type) require structural equality checks). */ tree -build_variant_type_copy (tree type) +build_variant_type_copy (tree type MEM_STAT_DECL) { tree t, m = TYPE_MAIN_VARIANT (type); - t = build_distinct_type_copy (type); + t = build_distinct_type_copy (type PASS_MEM_STAT); /* Since we're building a variant, assume that it is a non-semantic variant. This also propagates TYPE_STRUCTURAL_EQUALITY_P. */ diff --git a/gcc/tree.h b/gcc/tree.h index b136f5cce6b..599d34fb3a5 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -4265,7 +4265,7 @@ extern tree get_qualified_type (tree, int); /* Like get_qualified_type, but creates the type if it does not exist. This function never returns NULL_TREE. */ -extern tree build_qualified_type (tree, int); +extern tree build_qualified_type (tree, int CXX_MEM_STAT_INFO); /* Create a variant of type T with alignment ALIGN. */ @@ -4283,8 +4283,8 @@ extern tree build_aligned_type (tree, unsigned int); /* Make a copy of a type node. */ -extern tree build_distinct_type_copy (tree); -extern tree build_variant_type_copy (tree); +extern tree build_distinct_type_copy (tree CXX_MEM_STAT_INFO); +extern tree build_variant_type_copy (tree CXX_MEM_STAT_INFO); /* Given a hashcode and a ..._TYPE node (for which the hashcode was made), return a canonicalized ..._TYPE node, so that duplicates are not made.