diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-08-07 10:44:14 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-08-07 10:44:14 +0000 |
commit | 39c8aaa4bfab14d348ffbe515b332f03383eb1e9 (patch) | |
tree | e1ee8dbd0c20ebb30d7feede4036d428ac99a76f /gcc/lto | |
parent | 66b5e890ec57bcd04ccde2b69cdd88810697667e (diff) | |
download | gcc-39c8aaa4bfab14d348ffbe515b332f03383eb1e9.zip gcc-39c8aaa4bfab14d348ffbe515b332f03383eb1e9.tar.gz gcc-39c8aaa4bfab14d348ffbe515b332f03383eb1e9.tar.bz2 |
convert the rest of the users of pointer_map to hash_map
gcc/
* hash-map.h (default_hashmap_traits): Adjust overloads of hash
function to not conflict.
* alias.c, cfgexpand.c, dse.c, except.h, gimple-expr.c,
gimple-ssa-strength-reduction.c, gimple-ssa.h, ifcvt.c,
lto-streamer-out.c, lto-streamer.h, tree-affine.c, tree-affine.h,
tree-predcom.c, tree-scalar-evolution.c, tree-ssa-loop-im.c,
tree-ssa-loop-niter.c, tree-ssa.c, value-prof.c: Use hash_map instead
of pointer_map.
gcc/cp/
* cp-tree.h, pt.c: Use hash_map instead of pointer_map.
gcc/lto/
* lto-partition.c, lto.c: Use hash_map instead of pointer_map.
From-SVN: r213703
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/lto/lto-partition.c | 17 | ||||
-rw-r--r-- | gcc/lto/lto.c | 15 |
3 files changed, 16 insertions, 20 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 2d0018ff..20f81b1 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,7 @@ +2014-08-07 Trevor Saunders <tsaunders@mozilla.com> + + * lto-partition.c, lto.c: Use hash_map instead of pointer_map. + 2014-08-02 Trevor Saunders <tsaunders@mozilla.com> * lto-partition.c, lto-partition.h: Use hash_set instead of diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index a5bcf92..1837b99 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -268,13 +268,10 @@ lto_1_to_1_map (void) { symtab_node *node; struct lto_file_decl_data *file_data; - struct pointer_map_t *pmap; + hash_map<lto_file_decl_data *, ltrans_partition> pmap; ltrans_partition partition; - void **slot; int npartitions = 0; - pmap = pointer_map_create (); - FOR_EACH_SYMBOL (node) { if (node->get_partitioning_class () != SYMBOL_PARTITION @@ -285,13 +282,12 @@ lto_1_to_1_map (void) if (file_data) { - slot = pointer_map_contains (pmap, file_data); - if (slot) - partition = (ltrans_partition) *slot; + ltrans_partition *slot = &pmap.get_or_insert (file_data); + if (*slot) + partition = *slot; else { partition = new_partition (file_data->file_name); - slot = pointer_map_insert (pmap, file_data); *slot = partition; npartitions++; } @@ -301,8 +297,7 @@ lto_1_to_1_map (void) else { partition = new_partition (""); - slot = pointer_map_insert (pmap, NULL); - *slot = partition; + pmap.put (NULL, partition); npartitions++; } @@ -314,8 +309,6 @@ lto_1_to_1_map (void) if (!npartitions) new_partition ("empty"); - pointer_map_destroy (pmap); - } /* Maximal partitioning. Put every new symbol into new partition if possible. */ diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 7ecdec2..6f864d9 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1007,8 +1007,9 @@ register_resolution (struct lto_file_decl_data *file_data, tree decl, if (resolution == LDPR_UNKNOWN) return; if (!file_data->resolution_map) - file_data->resolution_map = pointer_map_create (); - *pointer_map_insert (file_data->resolution_map, decl) = (void *)(size_t)resolution; + file_data->resolution_map + = new hash_map<tree, ld_plugin_symbol_resolution>; + file_data->resolution_map->put (decl, resolution); } /* Register DECL with the global symbol table and change its @@ -2887,7 +2888,6 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) FILE *resolution; int count = 0; struct lto_file_decl_data **decl_data; - void **res; symtab_node *snode; init_cgraph (); @@ -3014,18 +3014,17 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) /* Store resolutions into the symbol table. */ + ld_plugin_symbol_resolution_t *res; FOR_EACH_SYMBOL (snode) if (snode->real_symbol_p () && snode->lto_file_data && snode->lto_file_data->resolution_map - && (res = pointer_map_contains (snode->lto_file_data->resolution_map, - snode->decl))) - snode->resolution - = (enum ld_plugin_symbol_resolution)(size_t)*res; + && (res = snode->lto_file_data->resolution_map->get (snode->decl))) + snode->resolution = *res; for (i = 0; all_file_decl_data[i]; i++) if (all_file_decl_data[i]->resolution_map) { - pointer_map_destroy (all_file_decl_data[i]->resolution_map); + delete all_file_decl_data[i]->resolution_map; all_file_decl_data[i]->resolution_map = NULL; } |