aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@gcc.gnu.org>2016-04-05 01:20:00 +0000
committerPatrick Palka <ppalka@gcc.gnu.org>2016-04-05 01:20:00 +0000
commit7a7ac32ac65127c17183af776d771b8f8b072cf9 (patch)
tree5d77f7ebc216c41b2915991ee6a8accb5605b126 /gcc/cp/cp-tree.h
parentcefb34aaf0bfe75719989877320ef071284ea9db (diff)
downloadgcc-7a7ac32ac65127c17183af776d771b8f8b072cf9.zip
gcc-7a7ac32ac65127c17183af776d771b8f8b072cf9.tar.gz
gcc-7a7ac32ac65127c17183af776d771b8f8b072cf9.tar.bz2
Remove class cache_map and use ggc hash_maps instead (PR c++/70452)
gcc/cp/ChangeLog: PR c++/70452 * cp-tree.h (class cache_map): Remove. * constexpr.c (cv_cache): Change type to GTY((deletable)) hash_map<tree, tree> *. (maybe_constant_value): Adjust following the change to cv_cache. (clear_cv_cache): New static function. (clear_cv_and_fold_caches): Use it. * cp-gimplify.c (fold_cache): Change type to GTY((deletable)) hash_map<tree, tree> *. (clear_fold_cache): Adjust following the change to fold_cache. (cp_fold): Likewise. From-SVN: r234732
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index b7b770f..d2bf717 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5525,42 +5525,6 @@ extern cp_parameter_declarator *no_parameters;
/* True if we saw "#pragma GCC java_exceptions". */
extern bool pragma_java_exceptions;
-/* Data structure for a mapping from tree to tree that's only used as a cache;
- we don't GC-mark trees in the map, and we clear the map when collecting
- garbage. Global variables of this type must be marked
- GTY((cache,deletable)) so that the gt_cleare_cache function is called by
- ggc_collect but we don't try to load the map pointer from a PCH.
-
- FIXME improve to use keep_cache_entry. */
-class cache_map
-{
- /* Use a lazily initialized pointer rather than a map member since a
- hash_map can't be constructed in a static initializer. */
- hash_map<tree, tree> *map;
-
-public:
- tree get (tree key)
- {
- if (map)
- if (tree *slot = map->get (key))
- return *slot;
- return NULL_TREE;
- }
-
- bool put (tree key, tree val)
- {
- if (!map)
- map = new hash_map<tree, tree>;
- return map->put (key, val);
- }
-
- friend inline void gt_cleare_cache (cache_map &cm)
- {
- if (cm.map)
- cm.map->empty();
- }
-};
-
/* in call.c */
extern bool check_dtor_name (tree, tree);
int magic_varargs_p (tree);