aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-08-02 11:23:49 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-08-02 11:23:49 +0000
commit6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2 (patch)
treef0fb192e856fa98b7d91e225ff958dfcc1f602df /gcc/lto
parent2df06cec0a2fe611c5487bf54c4ef8e3b2b30543 (diff)
downloadgcc-6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2.zip
gcc-6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2.tar.gz
gcc-6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2.tar.bz2
add a hash_set based on hash_table
This allows us to replace the usage of pointer_set outside of pointer_map with a nicer interface. gcc/ada/ * gcc-interface/trans.c: Use hash_set instead of pointer_set. gcc/c-family/ * c-gimplify.c: Use hash_set instead of pointer_set. gcc/c/ * c-decl.c: Use hash_set instead of pointer_set. gcc/cp/ * class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c, method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set instead of pointer_set. gcc/fortran/ * openmp.c, trans-decl.c: Use hash_set instead of pointer_set. gcc/ * hash-set.h: new File. * cfgexpand.c, cfgloop.c, cgraph.c, cgraphbuild.c, cgraphunit.c, cprop.c, cse.c, gimple-walk.c, gimple-walk.h, gimplify.c, godump.c, ipa-devirt.c, ipa-pure-const.c, ipa-visibility.c, ipa.c, lto-cgraph.c, lto-streamer-out.c, stmt.c, tree-cfg.c, tree-core.h, tree-eh.c, tree-inline.c, tree-inline.h, tree-nested.c, tree-pretty-print.c, tree-ssa-loop-niter.c, tree-ssa-phiopt.c, tree-ssa-threadedge.c, tree-ssa-uninit.c, tree.c, tree.h, value-prof.c, varasm.c, varpool.c: Use hash_set instead of pointer_set. gcc/lto/ * lto-partition.c, lto-partition.h: Use hash_set instead of pointer_set. From-SVN: r213516
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-partition.c8
-rw-r--r--gcc/lto/lto-partition.h3
3 files changed, 11 insertions, 5 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index fbb9d6b..2d0018ff 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
+
+ * lto-partition.c, lto-partition.h: Use hash_set instead of
+ pointer_set.
+
2014-07-31 Andi Kleen <ak@linux.intel.com>
* lto.c (hash_canonical_type): Use inchash::hash
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index cb08a88..a5bcf92 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -66,7 +66,7 @@ free_ltrans_partitions (void)
for (idx = 0; ltrans_partitions.iterate (idx, &part); idx++)
{
if (part->initializers_visited)
- pointer_set_destroy (part->initializers_visited);
+ delete part->initializers_visited;
/* Symtab encoder is freed after streaming. */
free (part);
}
@@ -101,8 +101,8 @@ add_references_to_partition (ltrans_partition part, symtab_node *node)
&& !lto_symtab_encoder_in_partition_p (part->encoder, ref->referred))
{
if (!part->initializers_visited)
- part->initializers_visited = pointer_set_create ();
- if (!pointer_set_insert (part->initializers_visited, ref->referred))
+ part->initializers_visited = new hash_set<symtab_node *>;
+ if (!part->initializers_visited->add (ref->referred))
add_references_to_partition (part, ref->referred);
}
}
@@ -250,7 +250,7 @@ undo_partition (ltrans_partition partition, unsigned int n_nodes)
/* After UNDO we no longer know what was visited. */
if (partition->initializers_visited)
- pointer_set_destroy (partition->initializers_visited);
+ delete partition->initializers_visited;
partition->initializers_visited = NULL;
if (!node->alias && (cnode = dyn_cast <cgraph_node *> (node)))
diff --git a/gcc/lto/lto-partition.h b/gcc/lto/lto-partition.h
index 8db61b3..50ec2fa 100644
--- a/gcc/lto/lto-partition.h
+++ b/gcc/lto/lto-partition.h
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include "hash-set.h"
/* Structure describing ltrans partitions. */
@@ -25,7 +26,7 @@ struct ltrans_partition_def
lto_symtab_encoder_t encoder;
const char * name;
int insns;
- pointer_set_t *initializers_visited;
+ hash_set<symtab_node *> *initializers_visited;
};
typedef struct ltrans_partition_def *ltrans_partition;