diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-25 17:06:44 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-25 17:06:44 +0000 |
commit | eae1ecb4918474af2840cd4b8b5657eb4fe46df7 (patch) | |
tree | 2e989ada68962878a3c51638dc18cf3f243933ca /gcc/hash-traits.h | |
parent | b594087e1afe41db9d100f08644715702d6cfc1b (diff) | |
download | gcc-eae1ecb4918474af2840cd4b8b5657eb4fe46df7.tar.gz |
gcc/
* hash-traits.h (ggc_cache_hasher): Rename to...
(ggc_cache_remove): ...this and remove typedefs.
(ggc_cache_ptr_hash): New class.
* hash-table.h: Update commentary.
* emit-rtl.c (const_int_hasher): Inherit from ggc_cache_ptr_hash
rather than ggc_cache_hasher.
(const_wide_int_hasher, reg_attr_hasher): Likewise.
(const_double_hasher, const_fixed_hasher): Likewise.
* function.c (insn_cache_hasher): Likewise.
* trans-mem.c (tm_wrapper_hasher): Likewise.
* tree.h (tree_decl_map_cache_hasher): Likewise.
* tree.c (type_cache_hasher, int_cst_hasher): Likewise.
(cl_option_hasher, tree_vec_map_cache_hasher): Likewise.
* ubsan.c (tree_type_map_cache_hasher): Likewise.
* varasm.c (tm_clone_hasher): Likewise.
* config/i386/i386.c (dllimport_hasher): Likewise.
* config/nvptx/nvptx.c (declared_libfunc_hasher): Likewise.
(tree_hasher): Likewise.
gcc/ada/
* gcc-interface/decl.c (value_annotation_hasher): Inherit from
ggc_cache_ptr_hash rather than ggc_cache_hasher.
* gcc-interface/utils.c (pad_type_hasher): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224960 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/hash-traits.h')
-rw-r--r-- | gcc/hash-traits.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/hash-traits.h b/gcc/hash-traits.h index 77f88f30dc6..5fd43f1f54f 100644 --- a/gcc/hash-traits.h +++ b/gcc/hash-traits.h @@ -149,14 +149,12 @@ struct ggc_remove } }; -/* Hasher for cache entry in gc memory. */ +/* Remover and marker for "cache" entries in gc memory. These entries can + be deleted if there are no non-cache references to the data. */ template<typename T> -struct ggc_cache_hasher : ggc_remove<T> +struct ggc_cache_remove : ggc_remove<T> { - typedef T value_type; - typedef T compare_type; - /* Entries are weakly held because this is for caches. */ static void ggc_mx (T &) {} @@ -185,4 +183,11 @@ struct free_ptr_hash : pointer_hash <T>, typed_free_remove <T> {}; template <typename T> struct ggc_ptr_hash : pointer_hash <T>, ggc_remove <T *> {}; +/* Traits for elements that point to gc memory. The elements don't + in themselves keep the pointed-to data alive and they can be deleted + if the pointed-to data is going to be collected. */ + +template <typename T> +struct ggc_cache_ptr_hash : pointer_hash <T>, ggc_cache_remove <T *> {}; + #endif |