summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c13
-rw-r--r--gcc/cp/semantics.c6
-rw-r--r--gcc/cp/tree.c8
-rw-r--r--gcc/cp/vtable-class-hierarchy.c4
5 files changed, 20 insertions, 16 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 170b90b7c75..f2f4e3cb5f0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-24 Trevor Saunders <tsaunders@mozilla.com>
+
+ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
+ Adjust.
+
2014-06-24 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_for_loop): For
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a96b3602786..1a7529e806c 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6709,7 +6709,7 @@ finish_struct (tree t, tree attributes)
}
/* Hash table to avoid endless recursion when handling references. */
-static hash_table <pointer_hash <tree_node> > fixed_type_or_null_ref_ht;
+static hash_table<pointer_hash<tree_node> > *fixed_type_or_null_ref_ht;
/* Return the dynamic type of INSTANCE, if known.
Used to determine whether the virtual function table is needed
@@ -6826,8 +6826,9 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp)
else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE)
{
/* We only need one hash table because it is always left empty. */
- if (!fixed_type_or_null_ref_ht.is_created ())
- fixed_type_or_null_ref_ht.create (37);
+ if (!fixed_type_or_null_ref_ht)
+ fixed_type_or_null_ref_ht
+ = new hash_table<pointer_hash<tree_node> > (37);
/* Reference variables should be references to objects. */
if (nonnull)
@@ -6839,15 +6840,15 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp)
if (VAR_P (instance)
&& DECL_INITIAL (instance)
&& !type_dependent_expression_p_push (DECL_INITIAL (instance))
- && !fixed_type_or_null_ref_ht.find (instance))
+ && !fixed_type_or_null_ref_ht->find (instance))
{
tree type;
tree_node **slot;
- slot = fixed_type_or_null_ref_ht.find_slot (instance, INSERT);
+ slot = fixed_type_or_null_ref_ht->find_slot (instance, INSERT);
*slot = instance;
type = RECUR (DECL_INITIAL (instance));
- fixed_type_or_null_ref_ht.remove_elt (instance);
+ fixed_type_or_null_ref_ht->remove_elt (instance);
return type;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ec510c96fed..aad6e2f4cb2 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4049,9 +4049,11 @@ expand_or_defer_fn (tree fn)
struct nrv_data
{
+ nrv_data () : visited (37) {}
+
tree var;
tree result;
- hash_table <pointer_hash <tree_node> > visited;
+ hash_table<pointer_hash <tree_node> > visited;
};
/* Helper function for walk_tree, used by finalize_nrv below. */
@@ -4131,9 +4133,7 @@ finalize_nrv (tree *tp, tree var, tree result)
data.var = var;
data.result = result;
- data.visited.create (37);
cp_walk_tree (tp, finalize_nrv_r, &data, 0);
- data.visited.dispose ();
}
/* Create CP_OMP_CLAUSE_INFO for clause C. Returns true if it is invalid. */
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 36166052d08..7ff593564ca 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2092,8 +2092,8 @@ static tree
verify_stmt_tree_r (tree* tp, int * /*walk_subtrees*/, void* data)
{
tree t = *tp;
- hash_table <pointer_hash <tree_node> > *statements
- = static_cast <hash_table <pointer_hash <tree_node> > *> (data);
+ hash_table<pointer_hash <tree_node> > *statements
+ = static_cast <hash_table<pointer_hash <tree_node> > *> (data);
tree_node **slot;
if (!STATEMENT_CODE_P (TREE_CODE (t)))
@@ -2116,10 +2116,8 @@ verify_stmt_tree_r (tree* tp, int * /*walk_subtrees*/, void* data)
void
verify_stmt_tree (tree t)
{
- hash_table <pointer_hash <tree_node> > statements;
- statements.create (37);
+ hash_table<pointer_hash <tree_node> > statements (37);
cp_walk_tree (&t, verify_stmt_tree_r, &statements, NULL);
- statements.dispose ();
}
/* Check if the type T depends on a type with no linkage and if so, return
diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c
index b481273ae85..f69e6bb3c95 100644
--- a/gcc/cp/vtable-class-hierarchy.c
+++ b/gcc/cp/vtable-class-hierarchy.c
@@ -1028,7 +1028,7 @@ register_all_pairs (tree body)
if (vtbl_ptr_array->length() > 0
|| (current->is_used
- || (current->registered.size() > 0)))
+ || (current->registered->size() > 0)))
{
insert_call_to_register_pair (vtbl_ptr_array,
arg1, arg2, size_hint_arg, str1,
@@ -1114,7 +1114,7 @@ write_out_vtv_count_data (void)
{
struct vtbl_map_node *current = vtbl_map_nodes_vec[i];
if (!current->is_used
- && current->registered.size() == 0)
+ && current->registered->size() == 0)
unused_vtbl_map_vars++;
}