diff options
author | Jan Hubicka <jh@suse.cz> | 2013-06-05 17:29:12 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-06-05 15:29:12 +0000 |
commit | 0378bddb9a01c78e75c95d4978e3e8eb04ab6d4b (patch) | |
tree | 0bf35bb18127d885aa49e476851292a5877cba99 /gcc/varasm.c | |
parent | 8f8a20576a873e0ce7be126ce8008c347dd49a4a (diff) | |
download | gcc-0378bddb9a01c78e75c95d4978e3e8eb04ab6d4b.zip gcc-0378bddb9a01c78e75c95d4978e3e8eb04ab6d4b.tar.gz gcc-0378bddb9a01c78e75c95d4978e3e8eb04ab6d4b.tar.bz2 |
varasm.c (mark_decl_referenced): Revert the removal until targets are fixed.
* varasm.c (mark_decl_referenced): Revert the removal until targets
are fixed.
From-SVN: r199699
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 4c4178f..c088ebf 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2244,6 +2244,33 @@ mark_referenced (tree id) TREE_SYMBOL_REFERENCED (id) = 1; } +/* Set the symbol_referenced flag for DECL and notify callgraph. */ +void +mark_decl_referenced (tree decl) +{ + if (TREE_CODE (decl) == FUNCTION_DECL) + { + /* Extern inline functions don't become needed when referenced. + If we know a method will be emitted in other TU and no new + functions can be marked reachable, just use the external + definition. */ + struct cgraph_node *node = cgraph_get_create_node (decl); + if (!DECL_EXTERNAL (decl) + && !node->symbol.definition) + cgraph_mark_force_output_node (node); + } + else if (TREE_CODE (decl) == VAR_DECL) + { + struct varpool_node *node = varpool_node_for_decl (decl); + /* C++ frontend use mark_decl_references to force COMDAT variables + to be output that might appear dead otherwise. */ + node->symbol.force_output = true; + } + /* else do nothing - we can get various sorts of CST nodes here, + which do not need to be marked. */ +} + + /* Follow the IDENTIFIER_TRANSPARENT_ALIAS chain starting at *ALIAS until we find an identifier that is not itself a transparent alias. Modify the alias passed to it by reference (and all aliases on the |