summaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-02 11:23:49 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-02 11:23:49 +0000
commit431205b753bfa26d1711e40ce478d9e92fd157da (patch)
treef0fb192e856fa98b7d91e225ff958dfcc1f602df /gcc/value-prof.c
parent69d7692e60d4a7c61b4d3581f3285a866ec3abb1 (diff)
downloadgcc-431205b753bfa26d1711e40ce478d9e92fd157da.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213516 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 3e51539c72d..ffdee650f7e 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "data-streamer.h"
#include "builtins.h"
#include "tree-nested.h"
+#include "hash-set.h"
/* In this file value profile based optimizations are placed. Currently the
following optimizations are implemented (for more detailed descriptions
@@ -515,10 +516,10 @@ static bool error_found = false;
static int
visit_hist (void **slot, void *data)
{
- struct pointer_set_t *visited = (struct pointer_set_t *) data;
+ hash_set<histogram_value> *visited = (hash_set<histogram_value> *) data;
histogram_value hist = *(histogram_value *) slot;
- if (!pointer_set_contains (visited, hist)
+ if (!visited->contains (hist)
&& hist->type != HIST_TYPE_TIME_PROFILE)
{
error ("dead histogram");
@@ -538,10 +539,9 @@ verify_histograms (void)
basic_block bb;
gimple_stmt_iterator gsi;
histogram_value hist;
- struct pointer_set_t *visited_hists;
error_found = false;
- visited_hists = pointer_set_create ();
+ hash_set<histogram_value> visited_hists;
FOR_EACH_BB_FN (bb, cfun)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
@@ -558,12 +558,11 @@ verify_histograms (void)
dump_histogram_value (stderr, hist);
error_found = true;
}
- pointer_set_insert (visited_hists, hist);
+ visited_hists.add (hist);
}
}
if (VALUE_HISTOGRAMS (cfun))
- htab_traverse (VALUE_HISTOGRAMS (cfun), visit_hist, visited_hists);
- pointer_set_destroy (visited_hists);
+ htab_traverse (VALUE_HISTOGRAMS (cfun), visit_hist, &visited_hists);
if (error_found)
internal_error ("verify_histograms failed");
}