diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-01 15:41:10 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-01 15:41:10 +0000 |
commit | adf64732e878f2cf03558d7663c53ae3184a5661 (patch) | |
tree | 2f02d6eeb6482da3c4542d6a466374959b925ead /gcc/tree.c | |
parent | 36ee0cde4a427e90cc11bfbe6aea40124b598551 (diff) | |
download | gcc-adf64732e878f2cf03558d7663c53ae3184a5661.tar.gz |
* cgraph.h (release_function_body): Declare.
* tree.c (free_lang_data_in_decl): Free, parameters and return values
of unused delcarations.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201413 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index ab1173525c7..c9f47d26260 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4886,6 +4886,20 @@ free_lang_data_in_decl (tree decl) if (TREE_CODE (decl) == FUNCTION_DECL) { + struct cgraph_node *node; + if (!(node = cgraph_get_node (decl)) + || (!node->symbol.definition && !node->clones)) + { + if (node) + cgraph_release_function_body (node); + else + { + release_function_body (decl); + DECL_ARGUMENTS (decl) = NULL; + DECL_RESULT (decl) = NULL; + DECL_INITIAL (decl) = error_mark_node; + } + } if (gimple_has_body_p (decl)) { tree t; |