#include "except.h"
#include "diagnostic.h"
#include "rtl.h"
-#include "ipa-utils.h"
static void cgraph_node_remove_callers (struct cgraph_node *node);
static inline void cgraph_edge_remove_caller (struct cgraph_edge *e);
node->previous = NULL;
node->global.estimated_growth = INT_MIN;
node->frequency = NODE_FREQUENCY_NORMAL;
- ipa_empty_ref_list (&node->ref_list);
cgraph_nodes = node;
cgraph_n_nodes++;
return node;
cgraph_call_node_removal_hooks (node);
cgraph_node_remove_callers (node);
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->ref_list);
- ipa_remove_all_refering (&node->ref_list);
VEC_free (ipa_opt_pass, heap,
node->ipa_transforms_to_apply);
{
if (!node->reachable && node->local.finalized)
{
- if (cgraph_global_info_ready)
- {
- /* Verify that function does not appear to be needed out of blue
- during the optimization process. This can happen for extern
- inlines when bodies was removed after inlining. */
- gcc_assert ((node->analyzed || DECL_EXTERNAL (node->decl)));
- }
- else
- notice_global_symbol (node->decl);
+ notice_global_symbol (node->decl);
node->reachable = 1;
+ gcc_assert (!cgraph_global_info_ready);
node->next_needed = cgraph_nodes_queue;
cgraph_nodes_queue = node;
fprintf(f, "(can throw external) ");
}
fprintf (f, "\n");
- fprintf (f, " References: ");
- ipa_dump_references (f, &node->ref_list);
- fprintf (f, " Refering this function: ");
- ipa_dump_refering (f, &node->ref_list);
for (edge = node->indirect_calls; edge; edge = edge->next_callee)
indirect_calls_count++;
for (e = n->indirect_calls; e; e = e->next_callee)
cgraph_clone_edge (e, new_node, e->call_stmt, e->lto_stmt_uid,
count_scale, freq, loop_nest, update_original);
- ipa_clone_references (new_node, NULL, &n->ref_list);
new_node->next_sibling_clone = n->clones;
if (n->clones)
struct cgraph_node *new_node = NULL;
tree new_decl;
struct cgraph_node key, **slot;
- size_t i;
- struct ipa_replace_map *map;
gcc_assert (tree_versionable_function_p (old_decl));
DECL_WEAK (new_node->decl) = 0;
new_node->clone.tree_map = tree_map;
new_node->clone.args_to_skip = args_to_skip;
- for (i = 0; VEC_iterate (ipa_replace_map_p, tree_map, i, map); i++)
- {
- tree var = map->new_tree;
-
- STRIP_NOPS (var);
- if (TREE_CODE (var) != ADDR_EXPR)
- continue;
- var = get_base_var (var);
- if (!var)
- continue;
-
- /* Record references of the future statement initializing the constant
- argument. */
- if (TREE_CODE (var) == FUNCTION_DECL)
- ipa_record_reference (new_node, NULL, cgraph_node (var),
- NULL, IPA_REF_ADDR, NULL);
- else if (TREE_CODE (var) == VAR_DECL)
- ipa_record_reference (new_node, NULL, NULL, varpool_node (var),
- IPA_REF_ADDR, NULL);
- }
if (!args_to_skip)
new_node->clone.combined_args_to_skip = old_node->clone.combined_args_to_skip;
else if (old_node->clone.combined_args_to_skip)
bool
cgraph_node_can_be_local_p (struct cgraph_node *node)
{
- return (!node->needed && !node->address_taken
+ return (!node->needed
&& ((DECL_COMDAT (node->decl) && !node->same_comdat_group)
|| !node->local.externally_visible));
}