summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-24 13:21:35 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-24 13:21:35 +0000
commitc1f445d2fbea31314327e0ce37f86184a6ae3de7 (patch)
treeb8d7f5b21a14b16949ddbc5dcaeb5f2b2654d63a /gcc/cp
parentd0285fb08b709575f6b35bf46efbae5e1cb3a40a (diff)
downloadgcc-c1f445d2fbea31314327e0ce37f86184a6ae3de7.tar.gz
Remove a layer of indirection from hash_table
gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211936 138bc75d-0d04-0410-961f-82ee72b054a4
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++;
}