diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-18 12:56:42 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-18 12:56:42 +0000 |
commit | be1cd1115338b965db5760b8af2eed4437b23882 (patch) | |
tree | 9e68c4d64c5b3c8af30ab8699be281e4d320a8e2 /gcc/tree-streamer.c | |
parent | 9da0ec36ea2482335b06865e2644edac01b10ad6 (diff) |
2013-06-18 Richard Biener <rguenther@suse.de>
* tree-streamer.h (streamer_tree_cache_create): Adjust prototype.
* tree-streamer.c (streamer_tree_cache_create): Make maintaining
the map from cache entry to cache index optional.
(streamer_tree_cache_replace_tree): Adjust accordingly.
(streamer_tree_cache_append): Likewise.
(streamer_tree_cache_delete): Likewise.
* lto-streamer-in.c (lto_data_in_create): Do not maintain the
streamer cache map from cache entry to cache index.
* lto-streamer-out.c (create_output_block): Adjust.
lto/
* lto.c (lto_register_var_decl_in_symtab): Pass in cache index
and use it.
(lto_register_function_decl_in_symtab): Likewise.
(cmp_tree): New function.
(unify_scc): Instead of using the streamer cache map from entry
to cache index match up the two maps we have by sorting them.
Adjust calls to lto_register_var_decl_in_symtab and
lto_register_function_decl_in_symtab.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200168 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-streamer.c')
-rw-r--r-- | gcc/tree-streamer.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/tree-streamer.c b/gcc/tree-streamer.c index fcdf43273506..86bad29c0129 100644 --- a/gcc/tree-streamer.c +++ b/gcc/tree-streamer.c @@ -197,7 +197,10 @@ streamer_tree_cache_replace_tree (struct streamer_tree_cache_d *cache, hashval_t hash = 0; if (cache->hashes.exists ()) hash = streamer_tree_cache_get_hash (cache, ix); - streamer_tree_cache_insert_1 (cache, t, hash, &ix, false); + if (!cache->node_map) + streamer_tree_cache_add_to_node_array (cache, ix, t, hash); + else + streamer_tree_cache_insert_1 (cache, t, hash, &ix, false); } @@ -208,7 +211,10 @@ streamer_tree_cache_append (struct streamer_tree_cache_d *cache, tree t, hashval_t hash) { unsigned ix = cache->nodes.length (); - streamer_tree_cache_insert_1 (cache, t, hash, &ix, false); + if (!cache->node_map) + streamer_tree_cache_add_to_node_array (cache, ix, t, hash); + else + streamer_tree_cache_insert_1 (cache, t, hash, &ix, false); } /* Return true if tree node T exists in CACHE, otherwise false. If IX_P is @@ -319,13 +325,14 @@ preload_common_nodes (struct streamer_tree_cache_d *cache) /* Create a cache of pickled nodes. */ struct streamer_tree_cache_d * -streamer_tree_cache_create (bool with_hashes) +streamer_tree_cache_create (bool with_hashes, bool with_map) { struct streamer_tree_cache_d *cache; cache = XCNEW (struct streamer_tree_cache_d); - cache->node_map = pointer_map_create (); + if (with_map) + cache->node_map = pointer_map_create (); cache->nodes.create (165); if (with_hashes) cache->hashes.create (165); @@ -347,7 +354,8 @@ streamer_tree_cache_delete (struct streamer_tree_cache_d *c) if (c == NULL) return; - pointer_map_destroy (c->node_map); + if (c->node_map) + pointer_map_destroy (c->node_map); c->nodes.release (); c->hashes.release (); free (c); |