summaryrefslogtreecommitdiff
path: root/gcc/hash-map.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/hash-map.h')
-rw-r--r--gcc/hash-map.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/hash-map.h b/gcc/hash-map.h
index 73f1c5427a0..6b8365a9d0a 100644
--- a/gcc/hash-map.h
+++ b/gcc/hash-map.h
@@ -62,6 +62,12 @@ class GTY((user)) hash_map
gt_ggc_mx (e.m_value);
}
+ static void ggc_maybe_mx (hash_entry &e)
+ {
+ if (Traits::maybe_mx)
+ ggc_mx (e);
+ }
+
static void pch_nx (hash_entry &e)
{
gt_pch_nx (e.m_key);
@@ -74,6 +80,11 @@ class GTY((user)) hash_map
pch_nx_helper (e.m_value, op, c);
}
+ static int keep_cache_entry (hash_entry &e)
+ {
+ return ggc_marked_p (e.m_key);
+ }
+
private:
template<typename T>
static void
@@ -237,7 +248,8 @@ private:
template<typename T, typename U, typename V> friend void gt_ggc_mx (hash_map<T, U, V> *);
template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *);
- template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *, gt_pointer_operator, void *);
+ template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *, gt_pointer_operator, void *);
+ template<typename T, typename U, typename V> friend void gt_cleare_cache (hash_map<T, U, V> *);
hash_table<hash_entry> m_table;
};
@@ -260,6 +272,13 @@ gt_pch_nx (hash_map<K, V, H> *h)
template<typename K, typename V, typename H>
static inline void
+gt_cleare_cache (hash_map<K, V, H> *h)
+{
+ gt_cleare_cache (&h->m_table);
+}
+
+template<typename K, typename V, typename H>
+static inline void
gt_pch_nx (hash_map<K, V, H> *h, gt_pointer_operator op, void *cookie)
{
op (&h->m_table.m_entries, cookie);