* lto-symtab.c (lto_cgraph_replace_node): Update.
* cgraphbuild.c (record_reference, record_type_list,
record_eh_tables, mark_address, mark_load, mark_store): Update.
* cgraph.c (cgraph_same_body_alias, dump_cgraph_node,
cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases):
Update.
* cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove.
(cgraph_alias_aliased_node, varpool_alias_aliased_node): Update.
* reload.c: Fix typo in comment.
* rtlanal.c: Likewise.
* tree-emultls.c (gen_emutls_addr): Update.
* ipa-reference.c (analyze_function): Update.
* cgraphunit.c (cgraph_analyze_function,
cgraph_process_same_body_aliases, assemble_thunks_and_aliases):
Update.
* ipa-ref.c (ipa_record_reference): Reorg to avoid reference types.
(ipa_remove_reference): Likewise.
(ipa_remove_all_refering): Rename to ...
(ipa_remove_all_referring): ... this one; update.
(ipa_dump_references): Update.
(ipa_dump_referring): Update.
(ipa_clone_references): Update.
(ipa_clone_refering): Rename to ...
(ipa_clone_referring): ... this one; update.
(ipa_ref_cannot_lead_to_return): Update.
(ipa_ref_has_aliases_p): Update.
* ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New
forward typedefs.
(ipa_ref_type): Remove.
(ipa_ref_ptr_u): Remove.
(ipa_ref): Remove referencing, refered, refered_index, refering_type
and refered_type; add referring, referred and referred_index.
(ipa_ref_list): Rename refering to referring.
(ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring,
ipa_clone_references, ipa_clone_referring): Update prototypes.
* lto-cgraph.c (referenced_from_other_partition_p): Update.
(lto_output_ref): Update.
(add_references): Update.
(input_varpool_node): Update.
(input_refs): Update.
* ipa-ref-inline.h (ipa_ref_node): Update.
(ipa_ref_varpool_node): Update.
(ipa_ref_referring_node); Update.
(ipa_ref_referring_varpool_node): Update.
(ipa_ref_referring_ref_list); Update.
(ipa_ref_referred_ref_list): Update.
(ipa_ref_list_first_referring): Update.
(ipa_empty_ref_list): Update.
(ipa_ref_list_refering_iterate): Rename to ...
(ipa_ref_list_referring_iterate): ... this one.
* cse.c: Update comment.
* ipa-utils.c (ipa_reverse_postorder): Update.
* tree-ssa-alias.c: Update.
* ipa-inline.c (reset_edge_caches): Update.
(update_caller_keys): Update.
* ipa-inline.h: Update comments.
* jump.c: Update comment.
* alias.c: Likewise.
* ipa.c (process_references): Update.
(cgraph_remove_unreachable_nodes): Likewise.
(ipa_discover_readonly_nonaddressable_var): Likewise.
(cgraph_address_taken_from_non_vtable_p): Likewise.
* trans-mem.c (ipa_tm_execute): Update.
* simplify-rtx.c: Fix comment.
* rtl.c: Fix comment.
* symtab.c (symtab_unregister_node): Update.
* varpool.c (dump_varpool_node): Update.
(varpool_analyze_pending_decls): Update.
(assemble_aliases): Update.
(varpool_for_node_and_aliases): Update.
From-SVN: r186564
+2012-04-18 Jan Hubicka <jh@suse.cz>
+
+ * lto-symtab.c (lto_cgraph_replace_node): Update.
+ * cgraphbuild.c (record_reference, record_type_list,
+ record_eh_tables, mark_address, mark_load, mark_store): Update.
+ * cgraph.c (cgraph_same_body_alias, dump_cgraph_node,
+ cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases):
+ Update.
+ * cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove.
+ (cgraph_alias_aliased_node, varpool_alias_aliased_node): Update.
+ * reload.c: Fix typo in comment.
+ * rtlanal.c: Likewise.
+ * tree-emultls.c (gen_emutls_addr): Update.
+ * ipa-reference.c (analyze_function): Update.
+ * cgraphunit.c (cgraph_analyze_function,
+ cgraph_process_same_body_aliases, assemble_thunks_and_aliases):
+ Update.
+ * ipa-ref.c (ipa_record_reference): Reorg to avoid reference types.
+ (ipa_remove_reference): Likewise.
+ (ipa_remove_all_refering): Rename to ...
+ (ipa_remove_all_referring): ... this one; update.
+ (ipa_dump_references): Update.
+ (ipa_dump_referring): Update.
+ (ipa_clone_references): Update.
+ (ipa_clone_refering): Rename to ...
+ (ipa_clone_referring): ... this one; update.
+ (ipa_ref_cannot_lead_to_return): Update.
+ (ipa_ref_has_aliases_p): Update.
+ * ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New
+ forward typedefs.
+ (ipa_ref_type): Remove.
+ (ipa_ref_ptr_u): Remove.
+ (ipa_ref): Remove referencing, refered, refered_index, refering_type
+ and refered_type; add referring, referred and referred_index.
+ (ipa_ref_list): Rename refering to referring.
+ (ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring,
+ ipa_clone_references, ipa_clone_referring): Update prototypes.
+ * lto-cgraph.c (referenced_from_other_partition_p): Update.
+ (lto_output_ref): Update.
+ (add_references): Update.
+ (input_varpool_node): Update.
+ (input_refs): Update.
+ * ipa-ref-inline.h (ipa_ref_node): Update.
+ (ipa_ref_varpool_node): Update.
+ (ipa_ref_referring_node); Update.
+ (ipa_ref_referring_varpool_node): Update.
+ (ipa_ref_referring_ref_list); Update.
+ (ipa_ref_referred_ref_list): Update.
+ (ipa_ref_list_first_referring): Update.
+ (ipa_empty_ref_list): Update.
+ (ipa_ref_list_refering_iterate): Rename to ...
+ (ipa_ref_list_referring_iterate): ... this one.
+ * cse.c: Update comment.
+ * ipa-utils.c (ipa_reverse_postorder): Update.
+ * tree-ssa-alias.c: Update.
+ * ipa-inline.c (reset_edge_caches): Update.
+ (update_caller_keys): Update.
+ * ipa-inline.h: Update comments.
+ * jump.c: Update comment.
+ * alias.c: Likewise.
+ * ipa.c (process_references): Update.
+ (cgraph_remove_unreachable_nodes): Likewise.
+ (ipa_discover_readonly_nonaddressable_var): Likewise.
+ (cgraph_address_taken_from_non_vtable_p): Likewise.
+ * trans-mem.c (ipa_tm_execute): Update.
+ * simplify-rtx.c: Fix comment.
+ * rtl.c: Fix comment.
+ * symtab.c (symtab_unregister_node): Update.
+ * varpool.c (dump_varpool_node): Update.
+ (varpool_analyze_pending_decls): Update.
+ (assemble_aliases): Update.
+ (varpool_for_node_and_aliases): Update.
+
2012-04-18 Richard Guenther <rguenther@suse.de>
* cfgloop.h (estimate_numbers_of_iterations_loop): Remove
return 0;
case TRUNCATE:
- /* As we do not know which address space the pointer is refering to, we can
+ /* As we do not know which address space the pointer is referring to, we can
handle this only if the target does not support different pointer or
address modes depending on the address space. */
if (!target_default_pointer_address_modes_p ())
case ZERO_EXTEND:
case SIGN_EXTEND: /* used for NT/Alpha pointers */
- /* As we do not know which address space the pointer is refering to, we can
+ /* As we do not know which address space the pointer is referring to, we can
handle this only if the target does not support different pointer or
address modes depending on the address space. */
if (!target_default_pointer_address_modes_p ())
return REG_BASE_VALUE (x);
case TRUNCATE:
- /* As we do not know which address space the pointer is refering to, we can
+ /* As we do not know which address space the pointer is referring to, we can
handle this only if the target does not support different pointer or
address modes depending on the address space. */
if (!target_default_pointer_address_modes_p ())
case ZERO_EXTEND:
case SIGN_EXTEND: /* Used for Alpha/NT pointers */
- /* As we do not know which address space the pointer is refering to, we can
+ /* As we do not know which address space the pointer is referring to, we can
handle this only if the target does not support different pointer or
address modes depending on the address space. */
if (!target_default_pointer_address_modes_p ())
&& ! rtx_equal_p (rtlx, rtly))
return 1;
- /* If we have MEMs refering to different address spaces (which can
+ /* If we have MEMs referring to different address spaces (which can
potentially overlap), we cannot easily tell from the addresses
whether the references overlap. */
if (MEM_P (rtlx) && MEM_P (rtly)
if (MEM_READONLY_P (x))
return 0;
- /* If we have MEMs refering to different address spaces (which can
+ /* If we have MEMs referring to different address spaces (which can
potentially overlap), we cannot easily tell from the addresses
whether the references overlap. */
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
if (!writep && MEM_READONLY_P (mem))
return 0;
- /* If we have MEMs refering to different address spaces (which can
+ /* If we have MEMs referring to different address spaces (which can
potentially overlap), we cannot easily tell from the addresses
whether the references overlap. */
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
if (MEM_READONLY_P (x))
return 0;
- /* If we have MEMs refering to different address spaces (which can
+ /* If we have MEMs referring to different address spaces (which can
potentially overlap), we cannot easily tell from the addresses
whether the references overlap. */
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
n = cgraph_create_function_alias (alias, decl);
n->same_body_alias = true;
if (same_body_aliases_done)
- ipa_record_reference (n, NULL, cgraph_get_node (decl), NULL, IPA_REF_ALIAS,
- NULL);
+ ipa_record_reference ((symtab_node)n, (symtab_node)cgraph_get_node (decl),
+ IPA_REF_ALIAS, NULL);
return n;
}
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, update_original);
- ipa_clone_references (new_node, NULL, &n->symbol.ref_list);
+ ipa_clone_references ((symtab_node)new_node, &n->symbol.ref_list);
new_node->next_sibling_clone = n->clones;
if (n->clones)
FOR_EACH_VEC_ELT (ipa_replace_map_p, tree_map, i, map)
{
tree var = map->new_tree;
+ symtab_node ref_node;
STRIP_NOPS (var);
if (TREE_CODE (var) != ADDR_EXPR)
var = get_base_var (var);
if (!var)
continue;
+ if (TREE_CODE (var) != FUNCTION_DECL
+ && TREE_CODE (var) != VAR_DECL)
+ continue;
/* Record references of the future statement initializing the constant
argument. */
- if (TREE_CODE (var) == FUNCTION_DECL)
- {
- struct cgraph_node *ref_node = cgraph_get_node (var);
- gcc_checking_assert (ref_node);
- ipa_record_reference (new_node, NULL, ref_node, 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);
+ ref_node = symtab_get_node (var);
+ gcc_checking_assert (ref_node);
+ ipa_record_reference ((symtab_node)new_node, (symtab_node)ref_node,
+ IPA_REF_ADDR, NULL);
}
if (!args_to_skip)
new_node->clone.combined_args_to_skip = old_node->clone.combined_args_to_skip;
if (cgraph_for_node_thunks_and_aliases (e->caller, callback, data,
include_overwritable))
return true;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
- struct cgraph_node *alias = ipa_ref_refering_node (ref);
+ struct cgraph_node *alias = ipa_ref_referring_node (ref);
if (include_overwritable
|| cgraph_function_body_availability (alias) > AVAIL_OVERWRITABLE)
if (cgraph_for_node_thunks_and_aliases (alias, callback, data,
if (callback (node, data))
return true;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
- struct cgraph_node *alias = ipa_ref_refering_node (ref);
+ struct cgraph_node *alias = ipa_ref_referring_node (ref);
if (include_overwritable
|| cgraph_function_body_availability (alias) > AVAIL_OVERWRITABLE)
if (cgraph_for_node_and_aliases (alias, callback, data,
SYMTAB_VARIABLE
};
-union symtab_node_def;
-typedef union symtab_node_def *symtab_node;
-typedef const union symtab_node_def *const_symtab_node;
-
/* Base of all entries in the symbol table.
The symtab_node is inherited by cgraph and varpol nodes. */
struct GTY(()) symtab_node_base
ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
- if (ref->refered_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referred))
return ipa_ref_node (ref);
return NULL;
}
ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
- if (ref->refered_type == IPA_REF_VARPOOL)
+ if (symtab_variable_p (ref->referred))
return ipa_ref_varpool_node (ref);
return NULL;
}
struct cgraph_node *node = cgraph_get_create_node (decl);
if (!ctx->only_vars)
cgraph_mark_address_taken_node (node);
- ipa_record_reference (NULL, ctx->varpool_node, node, NULL,
+ ipa_record_reference ((symtab_node)ctx->varpool_node,
+ (symtab_node)node,
IPA_REF_ADDR, NULL);
}
if (lang_hooks.callgraph.analyze_expr)
lang_hooks.callgraph.analyze_expr (&decl, walk_subtrees);
varpool_mark_needed_node (vnode);
- ipa_record_reference (NULL, ctx->varpool_node,
- NULL, vnode,
+ ipa_record_reference ((symtab_node)ctx->varpool_node,
+ (symtab_node)vnode,
IPA_REF_ADDR, NULL);
}
*walk_subtrees = 0;
{
struct varpool_node *vnode = varpool_node (type);
varpool_mark_needed_node (vnode);
- ipa_record_reference (node, NULL,
- NULL, vnode,
+ ipa_record_reference ((symtab_node)node,
+ (symtab_node)vnode,
IPA_REF_ADDR, NULL);
}
}
struct cgraph_node *per_node;
per_node = cgraph_get_create_node (DECL_FUNCTION_PERSONALITY (node->symbol.decl));
- ipa_record_reference (node, NULL, per_node, NULL, IPA_REF_ADDR, NULL);
+ ipa_record_reference ((symtab_node)node, (symtab_node)per_node, IPA_REF_ADDR, NULL);
cgraph_mark_address_taken_node (per_node);
}
{
struct cgraph_node *node = cgraph_get_create_node (addr);
cgraph_mark_address_taken_node (node);
- ipa_record_reference ((struct cgraph_node *)data, NULL,
- node, NULL,
+ ipa_record_reference ((symtab_node)data,
+ (symtab_node)node,
IPA_REF_ADDR, stmt);
}
else if (addr && TREE_CODE (addr) == VAR_DECL
if (lang_hooks.callgraph.analyze_expr)
lang_hooks.callgraph.analyze_expr (&addr, &walk_subtrees);
varpool_mark_needed_node (vnode);
- ipa_record_reference ((struct cgraph_node *)data, NULL,
- NULL, vnode,
+ ipa_record_reference ((symtab_node)data,
+ (symtab_node)vnode,
IPA_REF_ADDR, stmt);
}
directly manipulated in the code. Pretend that it's an address. */
struct cgraph_node *node = cgraph_get_create_node (t);
cgraph_mark_address_taken_node (node);
- ipa_record_reference ((struct cgraph_node *)data, NULL,
- node, NULL,
+ ipa_record_reference ((symtab_node)data,
+ (symtab_node)node,
IPA_REF_ADDR, stmt);
}
else if (t && TREE_CODE (t) == VAR_DECL
if (lang_hooks.callgraph.analyze_expr)
lang_hooks.callgraph.analyze_expr (&t, &walk_subtrees);
varpool_mark_needed_node (vnode);
- ipa_record_reference ((struct cgraph_node *)data, NULL,
- NULL, vnode,
+ ipa_record_reference ((symtab_node)data,
+ (symtab_node)vnode,
IPA_REF_LOAD, stmt);
}
return false;
if (lang_hooks.callgraph.analyze_expr)
lang_hooks.callgraph.analyze_expr (&t, &walk_subtrees);
varpool_mark_needed_node (vnode);
- ipa_record_reference ((struct cgraph_node *)data, NULL,
- NULL, vnode,
+ ipa_record_reference ((symtab_node)data,
+ (symtab_node)vnode,
IPA_REF_STORE, stmt);
}
return false;
&& gimple_omp_parallel_child_fn (stmt))
{
tree fn = gimple_omp_parallel_child_fn (stmt);
- ipa_record_reference (node, NULL, cgraph_get_create_node (fn),
- NULL, IPA_REF_ADDR, stmt);
+ ipa_record_reference ((symtab_node)node,
+ (symtab_node)cgraph_get_create_node (fn),
+ IPA_REF_ADDR, stmt);
}
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
{
tree fn = gimple_omp_task_child_fn (stmt);
if (fn)
- ipa_record_reference (node, NULL, cgraph_get_create_node (fn),
- NULL, IPA_REF_ADDR, stmt);
+ ipa_record_reference ((symtab_node)node,
+ (symtab_node) cgraph_get_create_node (fn),
+ IPA_REF_ADDR, stmt);
fn = gimple_omp_task_copy_fn (stmt);
if (fn)
- ipa_record_reference (node, NULL, cgraph_get_create_node (fn),
- NULL, IPA_REF_ADDR, stmt);
+ ipa_record_reference ((symtab_node)node,
+ (symtab_node)cgraph_get_create_node (fn),
+ IPA_REF_ADDR, stmt);
}
}
for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
return;
}
if (!VEC_length (ipa_ref_t, node->symbol.ref_list.references))
- ipa_record_reference (node, NULL, tgt, NULL, IPA_REF_ALIAS, NULL);
+ ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
+ IPA_REF_ALIAS, NULL);
if (node->same_body_alias)
{
DECL_VIRTUAL_P (node->symbol.decl) = DECL_VIRTUAL_P (node->thunk.alias);
&& !VEC_length (ipa_ref_t, node->symbol.ref_list.references))
{
struct cgraph_node *tgt = cgraph_get_node (node->thunk.alias);
- ipa_record_reference (node, NULL, tgt, NULL, IPA_REF_ALIAS, NULL);
+ ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
+ IPA_REF_ALIAS, NULL);
}
same_body_aliases_done = true;
}
}
else
e = e->next_caller;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
- struct cgraph_node *alias = ipa_ref_refering_node (ref);
+ struct cgraph_node *alias = ipa_ref_referring_node (ref);
bool saved_written = TREE_ASM_WRITTEN (alias->thunk.alias);
/* Force assemble_alias to really output the alias this time instead
if (GET_MODE (x) != GET_MODE (y))
return 0;
- /* MEMs refering to different address space are not equivalent. */
+ /* MEMs referring to different address space are not equivalent. */
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
return 0;
for (edge = where->callers; edge; edge = edge->next_caller)
if (edge->inline_failed)
reset_edge_growth_cache (edge);
- for (i = 0; ipa_ref_list_refering_iterate (&where->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&where->symbol.ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
- reset_edge_caches (ipa_ref_refering_node (ref));
+ reset_edge_caches (ipa_ref_referring_node (ref));
if (!e)
return;
if (!bitmap_set_bit (updated_nodes, node->uid))
return;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
- struct cgraph_node *alias = ipa_ref_refering_node (ref);
+ struct cgraph_node *alias = ipa_ref_referring_node (ref);
update_caller_keys (heap, alias, updated_nodes, check_inlinablity_for);
}
Conditions that are interesting for function body are collected into CONDS
vector. They are of simple for function_param OP VAL, where VAL is
- IPA invariant. The conditions are then refered by predicates. */
+ IPA invariant. The conditions are then referred by predicates. */
typedef struct GTY(()) condition
{
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* Return callgraph node REF is refering. */
+/* Return callgraph node REF is referring. */
static inline struct cgraph_node *
ipa_ref_node (struct ipa_ref *ref)
{
- gcc_assert (ref->refered_type == IPA_REF_CGRAPH);
- return ref->refered.cgraph_node;
+ return cgraph (ref->referred);
}
-/* Return varpool node REF is refering. */
+/* Return varpool node REF is referring. */
static inline struct varpool_node *
ipa_ref_varpool_node (struct ipa_ref *ref)
{
- gcc_assert (ref->refered_type == IPA_REF_VARPOOL);
- return ref->refered.varpool_node;
+ return varpool (ref->referred);
}
/* Return cgraph node REF is in. */
static inline struct cgraph_node *
-ipa_ref_refering_node (struct ipa_ref *ref)
+ipa_ref_referring_node (struct ipa_ref *ref)
{
- gcc_assert (ref->refering_type == IPA_REF_CGRAPH);
- return ref->refering.cgraph_node;
+ return cgraph (ref->referring);
}
/* Return varpool node REF is in. */
static inline struct varpool_node *
-ipa_ref_refering_varpool_node (struct ipa_ref *ref)
+ipa_ref_referring_varpool_node (struct ipa_ref *ref)
{
- gcc_assert (ref->refering_type == IPA_REF_VARPOOL);
- return ref->refering.varpool_node;
+ return varpool (ref->referring);
}
/* Return reference list REF is in. */
static inline struct ipa_ref_list *
-ipa_ref_refering_ref_list (struct ipa_ref *ref)
+ipa_ref_referring_ref_list (struct ipa_ref *ref)
{
- if (ref->refering_type == IPA_REF_CGRAPH)
- return &ipa_ref_refering_node (ref)->symbol.ref_list;
- else
- return &ipa_ref_refering_varpool_node (ref)->symbol.ref_list;
+ return &ref->referring->symbol.ref_list;
}
/* Return reference list REF is in. */
static inline struct ipa_ref_list *
-ipa_ref_refered_ref_list (struct ipa_ref *ref)
+ipa_ref_referred_ref_list (struct ipa_ref *ref)
{
- if (ref->refered_type == IPA_REF_CGRAPH)
- return &ipa_ref_node (ref)->symbol.ref_list;
- else
- return &ipa_ref_varpool_node (ref)->symbol.ref_list;
+ return &ref->referred->symbol.ref_list;
}
/* Return first reference in LIST or NULL if empty. */
return VEC_index (ipa_ref_t, list->references, 0);
}
-/* Return first refering ref in LIST or NULL if empty. */
+/* Return first referring ref in LIST or NULL if empty. */
static inline struct ipa_ref *
-ipa_ref_list_first_refering (struct ipa_ref_list *list)
+ipa_ref_list_first_referring (struct ipa_ref_list *list)
{
- if (!VEC_length (ipa_ref_ptr, list->refering))
+ if (!VEC_length (ipa_ref_ptr, list->referring))
return NULL;
- return VEC_index (ipa_ref_ptr, list->refering, 0);
+ return VEC_index (ipa_ref_ptr, list->referring, 0);
}
/* Clear reference list. */
static inline void
ipa_empty_ref_list (struct ipa_ref_list *list)
{
- list->refering = NULL;
+ list->referring = NULL;
list->references = NULL;
}
#define ipa_ref_list_reference_iterate(L,I,P) \
VEC_iterate(ipa_ref_t, (L)->references, (I), (P))
-#define ipa_ref_list_refering_iterate(L,I,P) \
- VEC_iterate(ipa_ref_ptr, (L)->refering, (I), (P))
+#define ipa_ref_list_referring_iterate(L,I,P) \
+ VEC_iterate(ipa_ref_ptr, (L)->referring, (I), (P))
/* Interprocedural reference lists.
- Copyright (C) 2010
+ Copyright (C) 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Jan Hubicka
of the use and STMT the statement (if it exists). */
struct ipa_ref *
-ipa_record_reference (struct cgraph_node *refering_node,
- struct varpool_node *refering_varpool_node,
- struct cgraph_node *refered_node,
- struct varpool_node *refered_varpool_node,
+ipa_record_reference (symtab_node referring_node,
+ symtab_node referred_node,
enum ipa_ref_use use_type, gimple stmt)
{
struct ipa_ref *ref;
struct ipa_ref_list *list, *list2;
VEC(ipa_ref_t,gc) *old_references;
- gcc_assert ((!refering_node) ^ (!refering_varpool_node));
- gcc_assert ((!refered_node) ^ (!refered_varpool_node));
- gcc_assert (!stmt || refering_node);
- gcc_assert (use_type != IPA_REF_ALIAS || !stmt);
- list = (refering_node ? &refering_node->symbol.ref_list
- : &refering_varpool_node->symbol.ref_list);
+ gcc_checking_assert (!stmt || symtab_function_p (referring_node));
+ gcc_checking_assert (use_type != IPA_REF_ALIAS || !stmt);
+
+ list = &referring_node->symbol.ref_list;
old_references = list->references;
VEC_safe_grow (ipa_ref_t, gc, list->references,
VEC_length (ipa_ref_t, list->references) + 1);
ref = VEC_last (ipa_ref_t, list->references);
- list2 = (refered_node ? &refered_node->symbol.ref_list
- : &refered_varpool_node->symbol.ref_list);
- VEC_safe_push (ipa_ref_ptr, heap, list2->refering, ref);
- ref->refered_index = VEC_length (ipa_ref_ptr, list2->refering) - 1;
- if (refering_node)
- {
- ref->refering.cgraph_node = refering_node;
- ref->refering_type = IPA_REF_CGRAPH;
- }
- else
- {
- ref->refering.varpool_node = refering_varpool_node;
- ref->refering_type = IPA_REF_VARPOOL;
- gcc_assert (use_type == IPA_REF_ADDR || use_type == IPA_REF_ALIAS);
- }
- if (refered_node)
- {
- ref->refered.cgraph_node = refered_node;
- ref->refered_type = IPA_REF_CGRAPH;
- gcc_assert (use_type == IPA_REF_ADDR || use_type == IPA_REF_ALIAS);
- }
- else
- {
- varpool_mark_needed_node (refered_varpool_node);
- ref->refered.varpool_node = refered_varpool_node;
- ref->refered_type = IPA_REF_VARPOOL;
- }
+ list2 = &referred_node->symbol.ref_list;
+ VEC_safe_push (ipa_ref_ptr, heap, list2->referring, ref);
+ ref->referred_index = VEC_length (ipa_ref_ptr, list2->referring) - 1;
+ ref->referring = referring_node;
+ ref->referred = referred_node;
ref->stmt = stmt;
ref->use = use_type;
int i;
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
VEC_replace (ipa_ref_ptr,
- ipa_ref_refered_ref_list (ref)->refering,
- ref->refered_index, ref);
+ ipa_ref_referred_ref_list (ref)->referring,
+ ref->referred_index, ref);
}
return ref;
}
void
ipa_remove_reference (struct ipa_ref *ref)
{
- struct ipa_ref_list *list = ipa_ref_refered_ref_list (ref);
- struct ipa_ref_list *list2 = ipa_ref_refering_ref_list (ref);
+ struct ipa_ref_list *list = ipa_ref_referred_ref_list (ref);
+ struct ipa_ref_list *list2 = ipa_ref_referring_ref_list (ref);
VEC(ipa_ref_t,gc) *old_references = list2->references;
struct ipa_ref *last;
- gcc_assert (VEC_index (ipa_ref_ptr, list->refering, ref->refered_index) == ref);
- last = VEC_last (ipa_ref_ptr, list->refering);
+ gcc_assert (VEC_index (ipa_ref_ptr, list->referring, ref->referred_index) == ref);
+ last = VEC_last (ipa_ref_ptr, list->referring);
if (ref != last)
{
- VEC_replace (ipa_ref_ptr, list->refering,
- ref->refered_index,
- VEC_last (ipa_ref_ptr, list->refering));
- VEC_index (ipa_ref_ptr, list->refering,
- ref->refered_index)->refered_index = ref->refered_index;
+ VEC_replace (ipa_ref_ptr, list->referring,
+ ref->referred_index,
+ VEC_last (ipa_ref_ptr, list->referring));
+ VEC_index (ipa_ref_ptr, list->referring,
+ ref->referred_index)->referred_index = ref->referred_index;
}
- VEC_pop (ipa_ref_ptr, list->refering);
+ VEC_pop (ipa_ref_ptr, list->referring);
last = VEC_last (ipa_ref_t, list2->references);
if (ref != last)
{
*ref = *last;
VEC_replace (ipa_ref_ptr,
- ipa_ref_refered_ref_list (ref)->refering,
- ref->refered_index, ref);
+ ipa_ref_referred_ref_list (ref)->referring,
+ ref->referred_index, ref);
}
VEC_pop (ipa_ref_t, list2->references);
gcc_assert (list2->references == old_references);
/* Remove all references in ref list LIST. */
void
-ipa_remove_all_refering (struct ipa_ref_list *list)
+ipa_remove_all_referring (struct ipa_ref_list *list)
{
- while (VEC_length (ipa_ref_ptr, list->refering))
- ipa_remove_reference (VEC_last (ipa_ref_ptr, list->refering));
- VEC_free (ipa_ref_ptr, heap, list->refering);
- list->refering = NULL;
+ while (VEC_length (ipa_ref_ptr, list->referring))
+ ipa_remove_reference (VEC_last (ipa_ref_ptr, list->referring));
+ VEC_free (ipa_ref_ptr, heap, list->referring);
+ list->referring = NULL;
}
/* Dump references in LIST to FILE. */
int i;
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
{
- if (ref->refered_type == IPA_REF_CGRAPH)
- {
- fprintf (file, " fn:%s/%i (%s)", cgraph_node_asm_name (ipa_ref_node (ref)),
- ipa_ref_node (ref)->symbol.order,
- ipa_ref_use_name [ref->use]);
- }
- else
- fprintf (file, " var:%s (%s)",
- varpool_node_asm_name (ipa_ref_varpool_node (ref)),
- ipa_ref_use_name [ref->use]);
+ fprintf (file, "%s/%i (%s)",
+ symtab_node_asm_name (ref->referred),
+ ref->referred->symbol.order,
+ ipa_ref_use_name [ref->use]);
}
fprintf (file, "\n");
}
-/* Dump refering in LIST to FILE. */
+/* Dump referring in LIST to FILE. */
void
-ipa_dump_refering (FILE * file, struct ipa_ref_list *list)
+ipa_dump_referring (FILE * file, struct ipa_ref_list *list)
{
struct ipa_ref *ref;
int i;
- for (i = 0; ipa_ref_list_refering_iterate (list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
{
- if (ref->refering_type == IPA_REF_CGRAPH)
- fprintf (file, " fn:%s/%i (%s)",
- cgraph_node_asm_name (ipa_ref_refering_node (ref)),
- ipa_ref_refering_node (ref)->symbol.order,
- ipa_ref_use_name [ref->use]);
- else
- fprintf (file, " var:%s (%s)",
- varpool_node_asm_name (ipa_ref_refering_varpool_node (ref)),
- ipa_ref_use_name [ref->use]);
+ fprintf (file, "%s/%i (%s)",
+ symtab_node_asm_name (ref->referring),
+ ref->referring->symbol.order,
+ ipa_ref_use_name [ref->use]);
}
fprintf (file, "\n");
}
/* Clone all references from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
void
-ipa_clone_references (struct cgraph_node *dest_node,
- struct varpool_node *dest_varpool_node,
+ipa_clone_references (symtab_node dest_node,
struct ipa_ref_list *src)
{
struct ipa_ref *ref;
int i;
for (i = 0; ipa_ref_list_reference_iterate (src, i, ref); i++)
- ipa_record_reference (dest_node, dest_varpool_node,
- ref->refered_type == IPA_REF_CGRAPH
- ? ipa_ref_node (ref) : NULL,
- ref->refered_type == IPA_REF_VARPOOL
- ? ipa_ref_varpool_node (ref) : NULL,
+ ipa_record_reference (dest_node,
+ ref->referred,
ref->use, ref->stmt);
}
-/* Clone all refering from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
+/* Clone all referring from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
void
-ipa_clone_refering (struct cgraph_node *dest_node,
- struct varpool_node *dest_varpool_node,
+ipa_clone_referring (symtab_node dest_node,
struct ipa_ref_list *src)
{
struct ipa_ref *ref;
int i;
- for (i = 0; ipa_ref_list_refering_iterate (src, i, ref); i++)
- ipa_record_reference (
- ref->refering_type == IPA_REF_CGRAPH
- ? ipa_ref_refering_node (ref) : NULL,
- ref->refering_type == IPA_REF_VARPOOL
- ? ipa_ref_refering_varpool_node (ref) : NULL,
- dest_node, dest_varpool_node,
+ for (i = 0; ipa_ref_list_referring_iterate (src, i, ref); i++)
+ ipa_record_reference (ref->referring,
+ dest_node,
ref->use, ref->stmt);
}
-/* Return true when execution of REF can load to return from
+/* Return true when execution of REF can lead to return from
function. */
bool
ipa_ref_cannot_lead_to_return (struct ipa_ref *ref)
{
- return cgraph_node_cannot_return (ipa_ref_refering_node (ref));
+ return cgraph_node_cannot_return (ipa_ref_referring_node (ref));
}
/* Return true if list contains an alias. */
{
struct ipa_ref *ref;
int i;
- for (i = 0; ipa_ref_list_refering_iterate (ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
return true;
return false;
struct cgraph_node;
struct varpool_node;
+union symtab_node_def;
+typedef union symtab_node_def *symtab_node;
+typedef const union symtab_node_def *const_symtab_node;
+
/* How the reference is done. */
enum GTY(()) ipa_ref_use
IPA_REF_ALIAS
};
-/* Type of refering or refered type. */
-enum GTY(()) ipa_ref_type
-{
- IPA_REF_CGRAPH,
- IPA_REF_VARPOOL
-};
-
-/* We can have references spanning both callgraph and varpool,
- so all pointers needs to be of both types. */
-union GTY(()) ipa_ref_ptr_u
-{
- struct cgraph_node * GTY((tag ("IPA_REF_CGRAPH"))) cgraph_node;
- struct varpool_node * GTY((tag ("IPA_REF_VARPOOL"))) varpool_node;
-};
-
/* Record of reference in callgraph or varpool. */
struct GTY(()) ipa_ref
{
- union ipa_ref_ptr_u GTY ((desc ("%1.refering_type"))) refering;
- union ipa_ref_ptr_u GTY ((desc ("%1.refered_type"))) refered;
+ symtab_node referring;
+ symtab_node referred;
gimple stmt;
- unsigned int refered_index;
- ENUM_BITFIELD (ipa_ref_type) refering_type:1;
- ENUM_BITFIELD (ipa_ref_type) refered_type:1;
+ unsigned int referred_index;
ENUM_BITFIELD (ipa_ref_use) use:2;
};
VEC(ipa_ref_t,gc) *references;
/* Refering is vector of pointers to references. It must not live in GGC space
or GGC will try to mark middle of references vectors. */
- VEC(ipa_ref_ptr,heap) * GTY((skip)) refering;
+ VEC(ipa_ref_ptr,heap) * GTY((skip)) referring;
};
-struct ipa_ref * ipa_record_reference (struct cgraph_node *,
- struct varpool_node *,
- struct cgraph_node *,
- struct varpool_node *,
+struct ipa_ref * ipa_record_reference (symtab_node,
+ symtab_node,
enum ipa_ref_use, gimple);
void ipa_remove_reference (struct ipa_ref *);
void ipa_remove_all_references (struct ipa_ref_list *);
-void ipa_remove_all_refering (struct ipa_ref_list *);
+void ipa_remove_all_referring (struct ipa_ref_list *);
void ipa_dump_references (FILE *, struct ipa_ref_list *);
-void ipa_dump_refering (FILE *, struct ipa_ref_list *);
-void ipa_clone_references (struct cgraph_node *, struct varpool_node *, struct ipa_ref_list *);
-void ipa_clone_refering (struct cgraph_node *, struct varpool_node *, struct ipa_ref_list *);
+void ipa_dump_referring (FILE *, struct ipa_ref_list *);
+void ipa_clone_references (symtab_node, struct ipa_ref_list *);
+void ipa_clone_referring (symtab_node, struct ipa_ref_list *);
bool ipa_ref_cannot_lead_to_return (struct ipa_ref *);
bool ipa_ref_has_aliases_p (struct ipa_ref_list *);
local = init_function_info (fn);
for (i = 0; ipa_ref_list_reference_iterate (&fn->symbol.ref_list, i, ref); i++)
{
- if (ref->refered_type != IPA_REF_VARPOOL)
+ if (!symtab_variable_p (ref->referred))
continue;
var = ipa_ref_varpool_node (ref)->symbol.decl;
if (ipa_ref_varpool_node (ref)->symbol.externally_visible
(cgraph_function_node (edge->callee, NULL)->symbol.decl))
node2 = NULL;
}
- for (;ipa_ref_list_refering_iterate (&stack[stack_size].node->symbol.ref_list,
+ for (;ipa_ref_list_referring_iterate (&stack[stack_size].node->symbol.ref_list,
stack[stack_size].ref,
ref) && !node2;
stack[stack_size].ref++)
{
if (ref->use == IPA_REF_ALIAS)
- node2 = ipa_ref_refering_node (ref);
+ node2 = ipa_ref_referring_node (ref);
}
if (!node2)
break;
struct ipa_ref *ref;
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
{
- if (ref->refered_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referred))
{
struct cgraph_node *node = ipa_ref_node (ref);
if (!node->reachable
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ADDR)
return true;
for (e = node->callers; e && !found; e = e->next_caller)
if (e->caller->reachable)
found = true;
- for (i = 0; (ipa_ref_list_refering_iterate (&node->symbol.ref_list,
+ for (i = 0; (ipa_ref_list_referring_iterate (&node->symbol.ref_list,
i, ref)
&& !found); i++)
- if (ref->refering_type == IPA_REF_CGRAPH
- && ipa_ref_refering_node (ref)->reachable)
+ if (symtab_function_p (ref->referring)
+ && ipa_ref_referring_node (ref)->reachable)
found = true;
- else if (ref->refering_type == IPA_REF_VARPOOL
- && ipa_ref_refering_varpool_node (ref)->needed)
+ else if (symtab_variable_p (ref->referring)
+ && ipa_ref_referring_varpool_node (ref)->needed)
found = true;
/* If so, we need to keep node in the callgraph. */
bool address_taken = false;
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_refering_iterate (&vnode->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&vnode->symbol.ref_list,
i, ref)
&& (!written || !address_taken); i++)
switch (ref->use)
{
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ADDR)
{
struct varpool_node *node;
- if (ref->refering_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referring))
return true;
- node = ipa_ref_refering_varpool_node (ref);
+ node = ipa_ref_referring_varpool_node (ref);
if (!DECL_VIRTUAL_P (node->symbol.decl))
return true;
}
if (GET_MODE (x) != GET_MODE (y))
return 0;
- /* MEMs refering to different address space are not equivalent. */
+ /* MEMs referring to different address space are not equivalent. */
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
return 0;
{
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_refering_iterate (list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
{
- if (ref->refering_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referring))
{
- if (ipa_ref_refering_node (ref)->symbol.in_other_partition
- || !cgraph_node_in_set_p (ipa_ref_refering_node (ref), set))
+ if (ipa_ref_referring_node (ref)->symbol.in_other_partition
+ || !cgraph_node_in_set_p (ipa_ref_referring_node (ref), set))
return true;
}
else
{
- if (ipa_ref_refering_varpool_node (ref)->symbol.in_other_partition
- || !varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
+ if (ipa_ref_referring_varpool_node (ref)->symbol.in_other_partition
+ || !varpool_node_in_set_p (ipa_ref_referring_varpool_node (ref),
vset))
return true;
}
{
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_refering_iterate (list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
{
- if (ref->refering_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referring))
{
- if (cgraph_node_in_set_p (ipa_ref_refering_node (ref), set))
+ if (cgraph_node_in_set_p (ipa_ref_referring_node (ref), set))
return true;
}
else
{
- if (varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
+ if (varpool_node_in_set_p (ipa_ref_referring_varpool_node (ref),
vset))
return true;
}
{
struct bitpack_d bp;
bp = bitpack_create (ob->main_stream);
- bp_pack_value (&bp, ref->refered_type, 1);
+ bp_pack_value (&bp, symtab_function_p (ref->referred), 1);
bp_pack_value (&bp, ref->use, 2);
streamer_write_bitpack (&bp);
- if (ref->refered_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referred))
{
int nref = lto_cgraph_encoder_lookup (encoder, ipa_ref_node (ref));
gcc_assert (nref != LCC_NOT_FOUND);
int i;
struct ipa_ref *ref;
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
- if (ref->refered_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referred))
add_node_to (encoder, ipa_ref_node (ref), false);
else
{
static void
input_ref (struct lto_input_block *ib,
- struct cgraph_node *refering_node,
- struct varpool_node *refering_varpool_node,
+ symtab_node referring_node,
VEC(cgraph_node_ptr, heap) *nodes,
VEC(varpool_node_ptr, heap) *varpool_nodes_vec)
{
struct cgraph_node *node = NULL;
struct varpool_node *varpool_node = NULL;
struct bitpack_d bp;
- enum ipa_ref_type type;
+ int type;
enum ipa_ref_use use;
bp = streamer_read_bitpack (ib);
- type = (enum ipa_ref_type) bp_unpack_value (&bp, 1);
+ type = bp_unpack_value (&bp, 1);
use = (enum ipa_ref_use) bp_unpack_value (&bp, 2);
- if (type == IPA_REF_CGRAPH)
+ if (type)
node = VEC_index (cgraph_node_ptr, nodes, streamer_read_hwi (ib));
else
varpool_node = VEC_index (varpool_node_ptr, varpool_nodes_vec,
streamer_read_hwi (ib));
- ipa_record_reference (refering_node, refering_varpool_node,
- node, varpool_node, use, NULL);
+ ipa_record_reference (referring_node,
+ node ? (symtab_node) node : (symtab_node) varpool_node, use, NULL);
}
/* Read an edge from IB. NODES points to a vector of previously read nodes for
node = VEC_index (cgraph_node_ptr, nodes, idx);
while (count)
{
- input_ref (ib, node, NULL, nodes, varpool);
+ input_ref (ib, (symtab_node) node, nodes, varpool);
count--;
}
}
streamer_read_uhwi (ib));
while (count)
{
- input_ref (ib, NULL, node, nodes, varpool);
+ input_ref (ib, (symtab_node) node, nodes, varpool);
count--;
}
}
e->call_stmt_cannot_inline_p = 1;
}
/* Redirect incomming references. */
- ipa_clone_refering (prevailing_node, NULL, &node->symbol.ref_list);
+ ipa_clone_referring ((symtab_node)prevailing_node, &node->symbol.ref_list);
/* Finally remove the replaced node. */
cgraph_remove_node (node);
gcc_assert (!vnode->finalized || prevailing_node->finalized);
gcc_assert (!vnode->analyzed || prevailing_node->analyzed);
- ipa_clone_refering (NULL, prevailing_node, &vnode->symbol.ref_list);
+ ipa_clone_referring ((symtab_node)prevailing_node, &vnode->symbol.ref_list);
/* Be sure we can garbage collect the initializer. */
if (DECL_INITIAL (vnode->symbol.decl))
+2012-04-18 Jan Hubicka <jh@suse.cz>
+
+ * lto-partition.c (add_references_to_partition, lto_balanced_map):
+ Update for new ipa-ref API.
+
2012-04-16 Jan Hubicka <jh@suse.cz>
* lto.c (read_cgraph_and_symbols): Use FOR_EACH
struct ipa_ref *ref;
for (i = 0; ipa_ref_list_reference_iterate (refs, i, ref); i++)
{
- if (ref->refered_type == IPA_REF_CGRAPH
+ if (symtab_function_p (ref->referred)
&& (DECL_COMDAT (cgraph_function_node (ipa_ref_node (ref),
NULL)->symbol.decl)
|| (ref->use == IPA_REF_ALIAS
&& !cgraph_node_in_set_p (ipa_ref_node (ref), part->cgraph_set))
add_cgraph_node_to_partition (part, ipa_ref_node (ref));
else
- if (ref->refered_type == IPA_REF_VARPOOL
+ if (symtab_variable_p (ref->referred)
&& (DECL_COMDAT (ipa_ref_varpool_node (ref)->symbol.decl)
|| (ref->use == IPA_REF_ALIAS
&& lookup_attribute
part->varpool_set))
add_varpool_node_to_partition (part, ipa_ref_varpool_node (ref));
}
- for (i = 0; ipa_ref_list_refering_iterate (refs, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (refs, i, ref); i++)
{
- if (ref->refering_type == IPA_REF_CGRAPH
+ if (symtab_function_p (ref->referring)
&& ref->use == IPA_REF_ALIAS
- && !cgraph_node_in_set_p (ipa_ref_refering_node (ref),
+ && !cgraph_node_in_set_p (ipa_ref_referring_node (ref),
part->cgraph_set)
&& !lookup_attribute ("weakref",
DECL_ATTRIBUTES
- (ipa_ref_refering_node (ref)->symbol.decl)))
- add_cgraph_node_to_partition (part, ipa_ref_refering_node (ref));
+ (ipa_ref_referring_node (ref)->symbol.decl)))
+ add_cgraph_node_to_partition (part, ipa_ref_referring_node (ref));
else
- if (ref->refering_type == IPA_REF_VARPOOL
+ if (symtab_variable_p (ref->referring)
&& ref->use == IPA_REF_ALIAS
- && !varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
+ && !varpool_node_in_set_p (ipa_ref_referring_varpool_node (ref),
part->varpool_set)
&& !lookup_attribute ("weakref",
DECL_ATTRIBUTES
- (ipa_ref_refering_varpool_node (ref)->symbol.decl)))
+ (ipa_ref_referring_varpool_node (ref)->symbol.decl)))
add_varpool_node_to_partition (part,
- ipa_ref_refering_varpool_node (ref));
+ ipa_ref_referring_varpool_node (ref));
}
}
/* Compute boundary cost of IPA REF edges and at the same time look into
variables referenced from current partition and try to add them. */
for (j = 0; ipa_ref_list_reference_iterate (refs, j, ref); j++)
- if (ref->refered_type == IPA_REF_VARPOOL)
+ if (symtab_variable_p (ref->referred))
{
varpool_node_set_iterator vsi;
else
cost++;
}
- for (j = 0; ipa_ref_list_refering_iterate (refs, j, ref); j++)
- if (ref->refering_type == IPA_REF_VARPOOL)
+ for (j = 0; ipa_ref_list_referring_iterate (refs, j, ref); j++)
+ if (symtab_variable_p (ref->referring))
{
varpool_node_set_iterator vsi;
- vnode = ipa_ref_refering_varpool_node (ref);
+ vnode = ipa_ref_referring_varpool_node (ref);
gcc_assert (vnode->finalized);
if (!vnode->symbol.aux && flag_toplevel_reorder
&& partition_varpool_node_p (vnode))
{
cgraph_node_set_iterator csi;
- node = ipa_ref_refering_node (ref);
+ node = ipa_ref_referring_node (ref);
gcc_assert (node->analyzed);
csi = cgraph_node_set_find (partition->cgraph_set, node);
if (!csi_end_p (csi)
ipa_ref_list_reference_iterate (&vnode->symbol.ref_list, i, ref);
i++)
{
- if (ref->refered_type == IPA_REF_CGRAPH)
+ if (symtab_function_p (ref->referred))
{
struct cgraph_node *n = ipa_ref_node (ref);
gcc_assert (!n->global.inlined_to);
if (GET_MODE (x) != GET_MODE (y))
return 0;
- /* MEMs refering to different address space are not equivalent. */
+ /* MEMs referring to different address space are not equivalent. */
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
return 0;
if (GET_MODE (x) != GET_MODE (y))
return 0;
- /* MEMs refering to different address space are not equivalent. */
+ /* MEMs referring to different address space are not equivalent. */
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
return 0;
if (GET_MODE (x) != GET_MODE (y))
return 0;
- /* MEMs refering to different address space are not equivalent. */
+ /* MEMs referring to different address space are not equivalent. */
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
return 0;
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
/* If pointers extend unsigned and this is a pointer in Pmode, say that
all the bits above ptr_mode are known to be zero. */
- /* As we do not know which address space the pointer is refering to,
+ /* As we do not know which address space the pointer is referring to,
we can do this only if the target does not support different pointer
or address modes depending on the address space. */
if (target_default_pointer_address_modes_p ()
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
/* If pointers extend signed and this is a pointer in Pmode, say that
all the bits above ptr_mode are known to be sign bit copies. */
- /* As we do not know which address space the pointer is refering to,
+ /* As we do not know which address space the pointer is referring to,
we can do this only if the target does not support different pointer
or address modes depending on the address space. */
if (target_default_pointer_address_modes_p ()
}
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
- /* As we do not know which address space the pointer is refering to,
+ /* As we do not know which address space the pointer is referring to,
we can do this only if the target does not support different pointer
or address modes depending on the address space. */
if (target_default_pointer_address_modes_p ()
}
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
- /* As we do not know which address space the pointer is refering to,
+ /* As we do not know which address space the pointer is referring to,
we can do this only if the target does not support different pointer
or address modes depending on the address space. */
if (target_default_pointer_address_modes_p ()
{
void **slot;
ipa_remove_all_references (&node->symbol.ref_list);
- ipa_remove_all_refering (&node->symbol.ref_list);
+ ipa_remove_all_referring (&node->symbol.ref_list);
if (node->symbol.same_comdat_group)
{
fprintf (f, " References: ");
ipa_dump_references (f, &node->symbol.ref_list);
- fprintf (f, " Refering: ");
- ipa_dump_refering (f, &node->symbol.ref_list);
+ fprintf (f, " Referring: ");
+ ipa_dump_referring (f, &node->symbol.ref_list);
}
/* Dump symtab node. */
}
/* Propagate back to referring aliases as well. */
- for (j = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, j, ref); j++)
+ for (j = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, j, ref); j++)
{
- caller = ref->refering.cgraph_node;
+ caller = cgraph (ref->referring);
if (ref->use == IPA_REF_ALIAS
&& !caller->local.tm_may_enter_irr)
{
/* We may be adding a new reference to a new variable to the function.
This means we have to play with the ipa-reference web. */
- ipa_record_reference (d->cfun_node, NULL, NULL, cvar, IPA_REF_ADDR, x);
+ ipa_record_reference ((symtab_node)d->cfun_node, (symtab_node)cvar, IPA_REF_ADDR, x);
/* Record this ssa_name for possible use later in the basic block. */
VEC_replace (tree, access_vars, index, addr);
|| CONSTANT_CLASS_P (base2))
return false;
- /* We can end up refering to code via function and label decls.
+ /* We can end up referring to code via function and label decls.
As we likely do not properly track code aliases conservatively
bail out. */
if (TREE_CODE (base1) == FUNCTION_DECL
continue;
}
if (!VEC_length (ipa_ref_t, node->symbol.ref_list.references))
- ipa_record_reference (NULL, node, NULL, tgt, IPA_REF_ALIAS, NULL);
+ ipa_record_reference ((symtab_node)node, (symtab_node)tgt, IPA_REF_ALIAS, NULL);
/* C++ FE sometimes change linkage flags after producing same body aliases. */
if (node->extra_name_alias)
{
{
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
- struct varpool_node *alias = ipa_ref_refering_varpool_node (ref);
+ struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
assemble_alias (alias->symbol.decl,
DECL_ASSEMBLER_NAME (alias->alias_of));
assemble_aliases (alias);
if (callback (node, data))
return true;
- for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
- struct varpool_node *alias = ipa_ref_refering_varpool_node (ref);
+ struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
if (include_overwritable
|| cgraph_variable_initializer_availability (alias) > AVAIL_OVERWRITABLE)
if (varpool_for_node_and_aliases (alias, callback, data,