summaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-12 09:12:47 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-12 09:12:47 +0000
commit9e9c3e92e9fbf4254b4ae185aeb345e2e08629e5 (patch)
treef90b96685d9ff8fb7b5722fdf8b1ff094b9c8b96 /gcc/lto
parente9b152974632d5f7c0303e03da34bb4077f37b8e (diff)
downloadgcc-9e9c3e92e9fbf4254b4ae185aeb345e2e08629e5.tar.gz
* lto-symtab.c (lto_symtab_merge_symbols): Populate symtab hashtable.
* cgraph.h (varpool_create_empty_node): Declare. * lto-cgraph.c (input_node, input_varpool_node): Forcingly create duplicated nodes. * symtab.c (symtab_unregister_node): Be lax about missin entries in node hash. (symtab_get_node): Update comment. * varpool.c (varpool_create_empty_node): Break out from ... (varpool_node_for_decl): ... here. * lto-streamer.h (lto_file_decl_data): Add RESOLUTION_MAP. * lto.c (register_resolution): Take lto_file_data argument. (lto_register_var_decl_in_symtab, lto_register_function_decl_in_symtab): Update. (read_cgraph_and_symbols): Update resolution_map handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199990 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog7
-rw-r--r--gcc/lto/lto.c46
2 files changed, 30 insertions, 23 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 153f023b4a1..216882afd13 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,10 @@
+2013-06-12 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (register_resolution): Take lto_file_data argument.
+ (lto_register_var_decl_in_symtab,
+ lto_register_function_decl_in_symtab): Update.
+ (read_cgraph_and_symbols): Update resolution_map handling.
+
2013-06-11 Jan Hubicka <jh@suse.cz>
* lto-partition.c (get_symbol_class): Simplify weakref handling.
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index c90a2d8496e..a4c5d29e974 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);