Commit f0c882ab by Jan Hubicka Committed by Jan Hubicka

cgraph.h (cgraph_mark_if_needed): New function.


	* cgraph.h (cgraph_mark_if_needed): New function.
	* cgraphunit.c (cgraph_mark_if_needed): New function.
	* c-decl.c (duplicate_decl): Use it.

From-SVN: r136893
parent ff2c88a5
2008-06-16 Jan Hubicka <jh@suse.cz>
* cgraph.h (cgraph_mark_if_needed): New function.
* cgraphunit.c (cgraph_mark_if_needed): New function.
* c-decl.c (duplicate_decl): Use it.
2008-06-16 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_add_new_function): When in expansion state, do
lowering.
......
......@@ -1915,7 +1915,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
to be called again. */
if (extern_changed && !new_is_definition
&& TREE_CODE (olddecl) == FUNCTION_DECL && DECL_INITIAL (olddecl))
cgraph_finalize_function (olddecl, false);
cgraph_mark_if_needed (olddecl);
}
/* Handle when a new declaration NEWDECL has the same name as an old
......
......@@ -331,6 +331,7 @@ void cgraph_add_new_function (tree, bool);
/* In cgraphunit.c */
void cgraph_finalize_function (tree, bool);
void cgraph_mark_if_needed (tree);
void cgraph_finalize_compilation_unit (void);
void cgraph_optimize (void);
void cgraph_mark_needed_node (struct cgraph_node *);
......
......@@ -642,6 +642,18 @@ cgraph_finalize_function (tree decl, bool nested)
do_warn_unused_parameter (decl);
}
/* C99 extern inline keywords allow changing of declaration after function
has been finalized. We need to re-decide if we want to mark the function as
needed then. */
void
cgraph_mark_if_needed (tree decl)
{
struct cgraph_node *node = cgraph_node (decl);
if (node->local.finalized && decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
}
/* Verify cgraph nodes of given cgraph node. */
void
verify_cgraph_node (struct cgraph_node *node)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment