diff options
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 995bcb9..2b79429 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -353,8 +353,22 @@ cgraph_assemble_pending_functions (void) } } + /* Process CGRAPH_EXPAND_QUEUE, these are functions created during + the expansion process. Note that this queue may grow as its + being processed, as the new functions may generate new ones. */ + while (cgraph_expand_queue) + { + struct cgraph_node *n = cgraph_expand_queue; + cgraph_expand_queue = cgraph_expand_queue->next_needed; + n->next_needed = NULL; + cgraph_finalize_function (n->decl, false); + output = true; + } + return output; } + + /* As an GCC extension we allow redefinition of the function. The semantics when both copies of bodies differ is not well defined. We replace the old body with new body so in unit at a time mode @@ -418,20 +432,6 @@ cgraph_lower_function (struct cgraph_node *node) node->lowered = true; } -static void -cgraph_finalize_pending_functions (void) -{ - struct cgraph_node *next, *node = cgraph_analyze_queue; - - cgraph_analyze_queue = NULL; - for (; node ; node = next) - { - next = node->next_needed; - node->next_needed = NULL; - cgraph_finalize_function (node->decl, true); - } -} - /* DECL has been parsed. Take it, queue it, compile it at the whim of the logic in effect. If NESTED is true, then our caller cannot stand to have the garbage collector run at the moment. We would need to either create @@ -458,7 +458,6 @@ cgraph_finalize_function (tree decl, bool nested) if (!flag_unit_at_a_time) { cgraph_analyze_function (node); - cgraph_finalize_pending_functions (); cgraph_decide_inlining_incrementally (node, false); } @@ -982,7 +981,6 @@ cgraph_finalize_compilation_unit (void) gcc_assert (DECL_SAVED_TREE (decl)); cgraph_analyze_function (node); - cgraph_finalize_pending_functions (); for (edge = node->callees; edge; edge = edge->next_callee) if (!edge->callee->reachable) @@ -1166,7 +1164,21 @@ cgraph_expand_all_functions (void) cgraph_expand_function (node); } } + free (order); + + /* Process CGRAPH_EXPAND_QUEUE, these are functions created during + the expansion process. Note that this queue may grow as its + being processed, as the new functions may generate new ones. */ + while (cgraph_expand_queue) + { + node = cgraph_expand_queue; + cgraph_expand_queue = cgraph_expand_queue->next_needed; + node->next_needed = NULL; + node->output = 0; + node->lowered = DECL_STRUCT_FUNCTION (node->decl)->cfg != NULL; + cgraph_expand_function (node); + } } /* This is used to sort the node types by the cgraph order number. */ |