diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-12 09:12:47 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-12 09:12:47 +0000 |
commit | 9e9c3e92e9fbf4254b4ae185aeb345e2e08629e5 (patch) | |
tree | f90b96685d9ff8fb7b5722fdf8b1ff094b9c8b96 /gcc/varpool.c | |
parent | e9b152974632d5f7c0303e03da34bb4077f37b8e (diff) | |
download | gcc-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/varpool.c')
-rw-r--r-- | gcc/varpool.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c index 4b238843aea..fd193d3c74a 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -36,18 +36,26 @@ along with GCC; see the file COPYING3. If not see #include "tree-flow.h" #include "flags.h" +/* Allocate new callgraph node and insert it into basic data structures. */ + +struct varpool_node * +varpool_create_empty_node (void) +{ + struct varpool_node *node = ggc_alloc_cleared_varpool_node (); + node->symbol.type = SYMTAB_VARIABLE; + return node; +} + /* Return varpool node assigned to DECL. Create new one when needed. */ struct varpool_node * varpool_node_for_decl (tree decl) { struct varpool_node *node = varpool_get_node (decl); - gcc_assert (TREE_CODE (decl) == VAR_DECL - && (TREE_STATIC (decl) || DECL_EXTERNAL (decl) || in_lto_p)); + gcc_checking_assert (TREE_CODE (decl) == VAR_DECL); if (node) return node; - node = ggc_alloc_cleared_varpool_node (); - node->symbol.type = SYMTAB_VARIABLE; + node = varpool_create_empty_node (); node->symbol.decl = decl; symtab_register_node ((symtab_node)node); return node; |