diff --git a/gcc/cgraph.c b/gcc/cgraph.c index cb49cdc..ad32fb8 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1716,13 +1716,15 @@ release_function_body (tree decl) are free'd in final.c via free_after_compilation(). */ void -cgraph_node::release_body (void) +cgraph_node::release_body (bool keep_arguments) { ipa_transforms_to_apply.release (); if (!used_as_abstract_origin && cgraph_state != CGRAPH_STATE_PARSING) { DECL_RESULT (decl) = NULL; - DECL_ARGUMENTS (decl) = NULL; + + if (!keep_arguments) + DECL_ARGUMENTS (decl) = NULL; } /* If the node is abstract and needed, then do not clear DECL_INITIAL of its associated function function declaration because it's diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 2594ae5..5edcf74 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -890,7 +890,7 @@ public: Use this only for functions that are released before being translated to target code (i.e. RTL). Functions that are compiled to RTL and beyond are free'd in final.c via free_after_compilation(). */ - void release_body (void); + void release_body (bool keep_arguments = false); /* cgraph_node is no longer nested function; update cgraph accordingly. */ void unnest (void);