diff options
Diffstat (limited to 'gcc/lto/lto.c')
| -rw-r--r-- | gcc/lto/lto.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index c90a2d8..a4c5d29 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1726,18 +1726,16 @@ get_resolution (struct data_in *data_in, unsigned index) return LDPR_UNKNOWN; } -/* Map assigning declarations their resolutions. */ -static pointer_map_t *resolution_map; - /* We need to record resolutions until symbol table is read. */ static void -register_resolution (tree decl, enum ld_plugin_symbol_resolution resolution) +register_resolution (struct lto_file_decl_data *file_data, tree decl, + enum ld_plugin_symbol_resolution resolution) { if (resolution == LDPR_UNKNOWN) return; - if (!resolution_map) - resolution_map = pointer_map_create (); - *pointer_map_insert (resolution_map, decl) = (void *)(size_t)resolution; + if (!file_data->resolution_map) + file_data->resolution_map = pointer_map_create (); + *pointer_map_insert (file_data->resolution_map, decl) = (void *)(size_t)resolution; } /* Register DECL with the global symbol table and change its @@ -1764,7 +1762,7 @@ lto_register_var_decl_in_symtab (struct data_in *data_in, tree decl) unsigned ix; if (!streamer_tree_cache_lookup (data_in->reader_cache, decl, &ix)) gcc_unreachable (); - register_resolution (decl, get_resolution (data_in, ix)); + register_resolution (data_in->file_data, decl, get_resolution (data_in, ix)); } } @@ -1784,7 +1782,7 @@ lto_register_function_decl_in_symtab (struct data_in *data_in, tree decl) unsigned ix; if (!streamer_tree_cache_lookup (data_in->reader_cache, decl, &ix)) gcc_unreachable (); - register_resolution (decl, get_resolution (data_in, ix)); + register_resolution (data_in->file_data, decl, get_resolution (data_in, ix)); } } @@ -2865,6 +2863,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) struct cgraph_node *node; int count = 0; struct lto_file_decl_data **decl_data; + void **res; + symtab_node snode; init_cgraph (); @@ -2971,21 +2971,21 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) input_symtab (); /* Store resolutions into the symbol table. */ - if (resolution_map) - { - void **res; - symtab_node snode; - FOR_EACH_SYMBOL (snode) - if (symtab_real_symbol_p (snode) - && (res = pointer_map_contains (resolution_map, - snode->symbol.decl))) - snode->symbol.resolution - = (enum ld_plugin_symbol_resolution)(size_t)*res; - - pointer_map_destroy (resolution_map); - resolution_map = NULL; - } + FOR_EACH_SYMBOL (snode) + if (symtab_real_symbol_p (snode) + && snode->symbol.lto_file_data + && snode->symbol.lto_file_data->resolution_map + && (res = pointer_map_contains (snode->symbol.lto_file_data->resolution_map, + snode->symbol.decl))) + snode->symbol.resolution + = (enum ld_plugin_symbol_resolution)(size_t)*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); + all_file_decl_data[i]->resolution_map = NULL; + } timevar_pop (TV_IPA_LTO_CGRAPH_IO); |
