diff options
author | Jan Hubicka <jh@suse.cz> | 2013-08-01 17:41:10 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-08-01 15:41:10 +0000 |
commit | 12123452e45937b341f187716a2a8343f0908465 (patch) | |
tree | 2f02d6eeb6482da3c4542d6a466374959b925ead /gcc | |
parent | ce852f9c3afff56097da5c352aba32e6191cdd3e (diff) | |
download | gcc-12123452e45937b341f187716a2a8343f0908465.zip gcc-12123452e45937b341f187716a2a8343f0908465.tar.gz gcc-12123452e45937b341f187716a2a8343f0908465.tar.bz2 |
cgraph.h (release_function_body): Declare.
* cgraph.h (release_function_body): Declare.
* tree.c (free_lang_data_in_decl): Free, parameters and return values
of unused delcarations.
From-SVN: r201413
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cgraph.h | 1 | ||||
-rw-r--r-- | gcc/tree.c | 14 |
3 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d60161e..bd846a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-01 Jan Hubicka <jh@suse.cz> + + * cgraph.h (release_function_body): Declare. + * tree.c (free_lang_data_in_decl): Free, parameters and return values + of unused delcarations. + 2013-08-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/arm/arm.md (minmax_arithsi_non_canon): Emit canonical RTL form diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 99acb62..9b76b67 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -606,6 +606,7 @@ void debug_cgraph_node (struct cgraph_node *); void cgraph_remove_edge (struct cgraph_edge *); void cgraph_remove_node (struct cgraph_node *); void cgraph_release_function_body (struct cgraph_node *); +void release_function_body (tree); void cgraph_node_remove_callees (struct cgraph_node *node); struct cgraph_edge *cgraph_create_edge (struct cgraph_node *, struct cgraph_node *, @@ -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; |