diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index e4bdf12..19b7a4f 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -103,6 +103,8 @@ typedef struct inline_data /* Hash table used to prevent walk_tree from visiting the same node umpteen million times. */ htab_t tree_pruner; + /* Decl of function we are inlining into. */ + tree decl; } inline_data; /* Prototypes. */ @@ -1368,6 +1370,13 @@ expand_call_inline (tp, walk_subtrees, data) /* For accounting, subtract one for the saved call/ret. */ id->inlined_stmts += DECL_NUM_STMTS (fn) - 1; + /* Update callgraph if needed. */ + if (id->decl && flag_unit_at_a_time) + { + cgraph_remove_call (id->decl, fn); + cgraph_create_edges (id->decl, *inlined_body); + } + /* Recurse into the body of the just inlined function. */ expand_calls_inline (inlined_body, id); VARRAY_POP (id->fns); @@ -1414,6 +1423,7 @@ optimize_inline_calls (fn) /* Clear out ID. */ memset (&id, 0, sizeof (id)); + id.decl = fn; /* Don't allow recursion into FN. */ VARRAY_TREE_INIT (id.fns, 32, "fns"); VARRAY_PUSH_TREE (id.fns, fn); |