Small cleanups in cgraph.
* cgraphunit.c (symtab_terminator): New variable. (queued_nodes): Renamed from first. Use symtab_terminator as initializer. (analyze_functions): Adjust accordingly. (cgraph_process_new_functions): Return void. * cgraph.h (cgraph_process_new_functions): Adjust declaration. From-SVN: r205024
This commit is contained in:
parent
d8a2d370dc
commit
b4d05578ef
3 changed files with 24 additions and 16 deletions
|
@ -1,3 +1,12 @@
|
|||
2013-11-19 Bernd Schmidt <bernds@codesourcery.com>
|
||||
|
||||
* cgraphunit.c (symtab_terminator): New variable.
|
||||
(queued_nodes): Renamed from first. Use symtab_terminator as
|
||||
initializer.
|
||||
(analyze_functions): Adjust accordingly.
|
||||
(cgraph_process_new_functions): Return void.
|
||||
* cgraph.h (cgraph_process_new_functions): Adjust declaration.
|
||||
|
||||
2013-11-19 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* opts.c (common_handle_option): Add -fsanitize=null option.
|
||||
|
@ -20,7 +29,7 @@
|
|||
(make_pass_sanopt): Likewise.
|
||||
(class pass_sanopt): New class.
|
||||
* ubsan.c: Include tree-pass.h, gimple-ssa.h, gimple-walk.h,
|
||||
gimple-iterator.h and cfgloop.h.
|
||||
gimple-iterator.h and cfgloop.h.
|
||||
(PROB_VERY_UNLIKELY): Define.
|
||||
(tree_type_map_hash): New function.
|
||||
(ubsan_type_descriptor): Add new parameter.
|
||||
|
|
|
@ -743,7 +743,7 @@ void cgraph_finalize_function (tree, bool);
|
|||
void finalize_compilation_unit (void);
|
||||
void compile (void);
|
||||
void init_cgraph (void);
|
||||
bool cgraph_process_new_functions (void);
|
||||
void cgraph_process_new_functions (void);
|
||||
void cgraph_process_same_body_aliases (void);
|
||||
void fixup_same_cpp_alias_visibility (symtab_node *, symtab_node *target, tree);
|
||||
/* Initialize datastructures so DECL is a function in lowered gimple form.
|
||||
|
|
|
@ -268,11 +268,13 @@ decide_is_symbol_needed (symtab_node *node)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Head of the queue of nodes to be processed while building callgraph */
|
||||
/* Head and terminator of the queue of nodes to be processed while building
|
||||
callgraph. */
|
||||
|
||||
static symtab_node *first = (symtab_node *)(void *)1;
|
||||
static symtab_node symtab_terminator;
|
||||
static symtab_node *queued_nodes = &symtab_terminator;
|
||||
|
||||
/* Add NODE to queue starting at FIRST.
|
||||
/* Add NODE to queue starting at QUEUED_NODES.
|
||||
The queue is linked via AUX pointers and terminated by pointer to 1. */
|
||||
|
||||
static void
|
||||
|
@ -280,25 +282,24 @@ enqueue_node (symtab_node *node)
|
|||
{
|
||||
if (node->aux)
|
||||
return;
|
||||
gcc_checking_assert (first);
|
||||
node->aux = first;
|
||||
first = node;
|
||||
gcc_checking_assert (queued_nodes);
|
||||
node->aux = queued_nodes;
|
||||
queued_nodes = node;
|
||||
}
|
||||
|
||||
/* Process CGRAPH_NEW_FUNCTIONS and perform actions necessary to add these
|
||||
functions into callgraph in a way so they look like ordinary reachable
|
||||
functions inserted into callgraph already at construction time. */
|
||||
|
||||
bool
|
||||
void
|
||||
cgraph_process_new_functions (void)
|
||||
{
|
||||
bool output = false;
|
||||
tree fndecl;
|
||||
struct cgraph_node *node;
|
||||
cgraph_node_set_iterator csi;
|
||||
|
||||
if (!cgraph_new_nodes)
|
||||
return false;
|
||||
return;
|
||||
handle_alias_pairs ();
|
||||
/* Note that this queue may grow as its being processed, as the new
|
||||
functions may generate new ones. */
|
||||
|
@ -313,7 +314,6 @@ cgraph_process_new_functions (void)
|
|||
it into reachable functions list. */
|
||||
|
||||
cgraph_finalize_function (fndecl, false);
|
||||
output = true;
|
||||
cgraph_call_function_insertion_hooks (node);
|
||||
enqueue_node (node);
|
||||
break;
|
||||
|
@ -354,7 +354,6 @@ cgraph_process_new_functions (void)
|
|||
}
|
||||
free_cgraph_node_set (cgraph_new_nodes);
|
||||
cgraph_new_nodes = NULL;
|
||||
return output;
|
||||
}
|
||||
|
||||
/* As an GCC extension we allow redefinition of the function. The
|
||||
|
@ -985,11 +984,11 @@ analyze_functions (void)
|
|||
|
||||
/* Lower representation, build callgraph edges and references for all trivially
|
||||
needed symbols and all symbols referred by them. */
|
||||
while (first != (symtab_node *)(void *)1)
|
||||
while (queued_nodes != &symtab_terminator)
|
||||
{
|
||||
changed = true;
|
||||
node = first;
|
||||
first = (symtab_node *)first->aux;
|
||||
node = queued_nodes;
|
||||
queued_nodes = (symtab_node *)queued_nodes->aux;
|
||||
cgraph_node *cnode = dyn_cast <cgraph_node> (node);
|
||||
if (cnode && cnode->definition)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue