summaryrefslogtreecommitdiff
path: root/gcc/vtable-verify.c
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/vtable-verify.c
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/vtable-verify.c')
-rw-r--r--gcc/vtable-verify.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/gcc/vtable-verify.c b/gcc/vtable-verify.c
index b99ff6cf896..96586c4820a 100644
--- a/gcc/vtable-verify.c
+++ b/gcc/vtable-verify.c
@@ -182,11 +182,10 @@ vtbl_map_node_registration_find (struct vtbl_map_node *node,
struct vtable_registration key;
struct vtable_registration **slot;
- gcc_assert (node && node->registered.is_created ());
+ gcc_assert (node && node->registered);
key.vtable_decl = vtable_decl;
- slot = (struct vtable_registration **) node->registered.find_slot (&key,
- NO_INSERT);
+ slot = node->registered->find_slot (&key, NO_INSERT);
if (slot && (*slot))
{
@@ -212,12 +211,11 @@ vtbl_map_node_registration_insert (struct vtbl_map_node *node,
struct vtable_registration **slot;
bool inserted_something = false;
- if (!node || !node->registered.is_created ())
+ if (!node || !node->registered)
return false;
key.vtable_decl = vtable_decl;
- slot = (struct vtable_registration **) node->registered.find_slot (&key,
- INSERT);
+ slot = node->registered->find_slot (&key, INSERT);
if (! *slot)
{
@@ -307,11 +305,11 @@ vtbl_map_hasher::equal (const value_type *p1, const compare_type *p2)
to find the nodes for various tasks (see comments in vtable-verify.h
for more details. */
-typedef hash_table <vtbl_map_hasher> vtbl_map_table_type;
+typedef hash_table<vtbl_map_hasher> vtbl_map_table_type;
typedef vtbl_map_table_type::iterator vtbl_map_iterator_type;
/* Vtable map variable nodes stored in a hash table. */
-static vtbl_map_table_type vtbl_map_hash;
+static vtbl_map_table_type *vtbl_map_hash;
/* Vtable map variable nodes stored in a vector. */
vec<struct vtbl_map_node *> vtbl_map_nodes_vec;
@@ -328,7 +326,7 @@ vtbl_map_get_node (tree class_type)
tree class_name;
unsigned int type_quals;
- if (!vtbl_map_hash.is_created ())
+ if (!vtbl_map_hash)
return NULL;
gcc_assert (TREE_CODE (class_type) == RECORD_TYPE);
@@ -346,8 +344,7 @@ vtbl_map_get_node (tree class_type)
class_name = DECL_ASSEMBLER_NAME (class_type_decl);
key.class_name = class_name;
- slot = (struct vtbl_map_node **) vtbl_map_hash.find_slot (&key,
- NO_INSERT);
+ slot = (struct vtbl_map_node **) vtbl_map_hash->find_slot (&key, NO_INSERT);
if (!slot)
return NULL;
return *slot;
@@ -365,8 +362,8 @@ find_or_create_vtbl_map_node (tree base_class_type)
tree class_type_decl;
unsigned int type_quals;
- if (!vtbl_map_hash.is_created ())
- vtbl_map_hash.create (10);
+ if (!vtbl_map_hash)
+ vtbl_map_hash = new vtbl_map_table_type (10);
/* Find the TYPE_DECL for the class. */
class_type_decl = TYPE_NAME (base_class_type);
@@ -377,8 +374,7 @@ find_or_create_vtbl_map_node (tree base_class_type)
gcc_assert (HAS_DECL_ASSEMBLER_NAME_P (class_type_decl));
key.class_name = DECL_ASSEMBLER_NAME (class_type_decl);
- slot = (struct vtbl_map_node **) vtbl_map_hash.find_slot (&key,
- INSERT);
+ slot = (struct vtbl_map_node **) vtbl_map_hash->find_slot (&key, INSERT);
if (*slot)
return *slot;
@@ -396,7 +392,7 @@ find_or_create_vtbl_map_node (tree base_class_type)
(node->class_info->parents).create (4);
(node->class_info->children).create (4);
- node->registered.create (16);
+ node->registered = new register_table_type (16);
node->is_used = false;