This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[LTO]: patch committed to update the cgraph
- From: Kenneth Zadeck <zadeck at naturalbridge dot com>
- To: Jan Hubicka <jh at suse dot cz>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 05 Sep 2007 17:00:42 -0400
- Subject: [LTO]: patch committed to update the cgraph
- References: <20070905185201.GP12961@kam.mff.cuni.cz>
This is really honza's patch, but he was not in a postion to put it in.
This rebuilds the cgraph after new functions are added.
2007-09-05 Jan Hubicka <jh@suse.cz>
* cgraphbuild.c (build_cgraph_edges): Export.
* cgraph.h (build_cgraph_edges): Declare.
* cgraphunit.c (cgraph_finalize_function): Rebuild cgraph edges.
committed as revision 128153.
kenny
Jan Hubicka wrote:
> * cgraphbuild.c (build_cgraph_edges): Export.
> * cgraph.h (build_cgraph_edges): Declare.
> * cgraphunit.c (cgraph_finalize_function): Rebuild cgraph edges.
> Index: cgraphbuild.c
> ===================================================================
> *** cgraphbuild.c (revision 128135)
> --- cgraphbuild.c (working copy)
> *************** initialize_inline_failed (struct cgraph_
> *** 108,114 ****
> /* Create cgraph edges for function calls.
> Also look for functions and variables having addresses taken. */
>
> ! static unsigned int
> build_cgraph_edges (void)
> {
> basic_block bb;
> --- 108,114 ----
> /* Create cgraph edges for function calls.
> Also look for functions and variables having addresses taken. */
>
> ! unsigned int
> build_cgraph_edges (void)
> {
> basic_block bb;
> Index: cgraph.h
> ===================================================================
> *** cgraph.h (revision 128135)
> --- cgraph.h (working copy)
> *************** varpool_next_static_initializer (struct
> *** 409,414 ****
> --- 409,415 ----
> void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool, bool);
> void cgraph_mark_inline_edge (struct cgraph_edge *, bool);
> bool cgraph_default_inline_p (struct cgraph_node *, const char **);
> + unsigned int build_cgraph_edges (void);
>
>
> /* Create a new static variable of type TYPE. */
> Index: cgraphunit.c
> ===================================================================
> *** cgraphunit.c (revision 128135)
> --- cgraphunit.c (working copy)
> *************** cgraph_finalize_function (tree decl, boo
> *** 528,536 ****
> --- 528,542 ----
> node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL;
> if (node->lowered)
> {
> + tree old_decl = current_function_decl;
> + current_function_decl = decl;
> + push_cfun (DECL_STRUCT_FUNCTION (decl));
> + build_cgraph_edges ();
> + pop_cfun ();
> DECL_STRUCT_FUNCTION (decl)->curr_properties
> |= (PROP_gimple_leh | PROP_cfg | PROP_referenced_vars
> | PROP_gimple_lomp | PROP_gimple_any | PROP_gimple_lcf);
> + current_function_decl = old_decl;
> }
> record_cdtor_fn (node->decl);
> if (node->nested)
>