Support GTY((cache)) on hash_map.
authorJason Merrill <jason@redhat.com>
Tue, 14 Nov 2017 16:02:57 +0000 (11:02 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 14 Nov 2017 16:02:57 +0000 (11:02 -0500)
commit21faa10189001f70361ca13133b01a815d2b342c
tree931e4ec35ba245c1ce72ae664a03ce5b25f38cb6
parent55518e0f5df1f1693e060ddd595a86ac816ec291
Support GTY((cache)) on hash_map.

gcc/
* hash-traits.h (ggc_remove): Add ggc_maybe_mx member function.
(ggc_cache_remove): Override it instead of ggc_mx.
* hash-table.h (gt_ggc_mx): Call it instead of ggc_mx.
(gt_cleare_cache): Call ggc_mx instead of gt_ggc_mx.
* hash-map-traits.h (simple_hashmap_traits): Add maybe_mx member.
(simple_cache_map_traits): Override maybe_mx.
* hash-map.h (hash_entry): Add ggc_maybe_mx and keep_cache_entry.
(hash_map): Friend gt_cleare_cache.
(gt_cleare_cache): New.
* tree.h (tree_cache_traits): New hash_map traits class.
(tree_cache_map): New typedef.
gcc/cp/
* decl.c (decomp_type_table): Use tree_cache_map.
* init.c (nsdmi_inst): Likewise.
* pt.c (defarg_ints): Likewise.
* cp-objcp-common.c (cp_get_debug_type): Likewise.

From-SVN: r254731
12 files changed:
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/init.c
gcc/cp/pt.c
gcc/hash-map-traits.h
gcc/hash-map.h
gcc/hash-table.h
gcc/hash-traits.h
gcc/tree.h