summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/decl.c17
-rw-r--r--gcc/cp/decl2.c28
-rw-r--r--gcc/cp/lambda.c5
-rw-r--r--gcc/cp/mangle.c4
-rw-r--r--gcc/cp/method.c25
-rw-r--r--gcc/cp/optimize.c37
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/cp/vtable-class-hierarchy.c4
10 files changed, 63 insertions, 65 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 61e2769807b..4d37c65209f 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6848,13 +6848,13 @@ mark_versions_used (tree fn)
gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
- node = cgraph_get_node (fn);
+ node = cgraph_node::get (fn);
if (node == NULL)
return;
gcc_assert (node->dispatcher_function);
- node_v = get_cgraph_node_version (node);
+ node_v = node->function_version ();
if (node_v == NULL)
return;
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index e4523c7b1f6..0f611e10a6f 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1147,7 +1147,7 @@ add_method (tree type, tree method, tree using_decl)
if (DECL_ASSEMBLER_NAME_SET_P (method))
mangle_decl (method);
}
- record_function_versions (fn, method);
+ cgraph_node::record_function_versions (fn, method);
continue;
}
if (DECL_INHERITED_CTOR_BASE (method))
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 87249a034a6..150c74e2ef7 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1072,7 +1072,7 @@ decls_match (tree newdecl, tree olddecl)
if (DECL_ASSEMBLER_NAME_SET_P (olddecl))
mangle_decl (olddecl);
}
- record_function_versions (olddecl, newdecl);
+ cgraph_node::record_function_versions (olddecl, newdecl);
return 0;
}
}
@@ -2074,10 +2074,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
{
struct symtab_node *symbol;
if (TREE_CODE (olddecl) == FUNCTION_DECL)
- symbol = cgraph_get_create_node (newdecl);
+ symbol = cgraph_node::get_create (newdecl);
else
symbol = varpool_node_for_decl (newdecl);
- symbol->set_comdat_group (symtab_get_node (olddecl)->get_comdat_group ());
+ symbol->set_comdat_group (symtab_node::get
+ (olddecl)->get_comdat_group ());
}
DECL_DEFER_OUTPUT (newdecl) |= DECL_DEFER_OUTPUT (olddecl);
@@ -2382,13 +2383,13 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
DECL_FUNCTION_VERSIONED (newdecl) = 1;
/* newdecl will be purged after copying to olddecl and is no longer
a version. */
- delete_function_version (newdecl);
+ cgraph_node::delete_function_version (newdecl);
}
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
int function_size;
- struct symtab_node *snode = symtab_get_node (olddecl);
+ struct symtab_node *snode = symtab_node::get (olddecl);
function_size = sizeof (struct tree_decl_common);
@@ -2450,7 +2451,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (TREE_CODE (olddecl) == VAR_DECL
&& (TREE_STATIC (olddecl) || TREE_PUBLIC (olddecl) || DECL_EXTERNAL (olddecl)))
- snode = symtab_get_node (olddecl);
+ snode = symtab_node::get (olddecl);
memcpy ((char *) olddecl + sizeof (struct tree_decl_common),
(char *) newdecl + sizeof (struct tree_decl_common),
size - sizeof (struct tree_decl_common)
@@ -2502,9 +2503,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (TREE_CODE (newdecl) == FUNCTION_DECL
|| TREE_CODE (newdecl) == VAR_DECL)
{
- struct symtab_node *snode = symtab_get_node (newdecl);
+ struct symtab_node *snode = symtab_node::get (newdecl);
if (snode)
- symtab_remove_node (snode);
+ snode->remove ();
}
ggc_free (newdecl);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 83a07e64d72..90244efab45 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1928,7 +1928,7 @@ mark_needed (tree decl)
If we know a method will be emitted in other TU and no new
functions can be marked reachable, just use the external
definition. */
- struct cgraph_node *node = cgraph_get_create_node (decl);
+ struct cgraph_node *node = cgraph_node::get_create (decl);
node->forced_by_abi = true;
}
else if (TREE_CODE (decl) == VAR_DECL)
@@ -2055,7 +2055,7 @@ maybe_emit_vtables (tree ctype)
{
current = varpool_node_for_decl (vtbl);
if (last)
- symtab_add_to_same_comdat_group (current, last);
+ current->add_to_same_comdat_group (last);
last = current;
}
}
@@ -2125,7 +2125,7 @@ constrain_visibility (tree decl, int visibility, bool tmpl)
if (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL)
{
- struct symtab_node *snode = symtab_get_node (decl);
+ struct symtab_node *snode = symtab_node::get (decl);
if (snode)
snode->set_comdat_group (NULL);
@@ -4252,8 +4252,8 @@ handle_tls_init (void)
if (single_init_fn == NULL_TREE)
continue;
cgraph_node *alias
- = cgraph_same_body_alias (cgraph_get_create_node (fn),
- single_init_fn, fn);
+ = cgraph_node::get_create (fn)->create_same_body_alias
+ (single_init_fn, fn);
gcc_assert (alias != NULL);
}
#endif
@@ -4521,21 +4521,21 @@ cp_write_global_declarations (void)
{
struct cgraph_node *node, *next;
- node = cgraph_get_node (decl);
+ node = cgraph_node::get (decl);
if (node->cpp_implicit_alias)
- node = cgraph_alias_target (node);
+ node = node->get_alias_target ();
- cgraph_for_node_and_aliases (node, clear_decl_external,
- NULL, true);
+ node->call_for_symbol_thunks_and_aliases (clear_decl_external,
+ NULL, true);
/* If we mark !DECL_EXTERNAL one of the symbols in some comdat
group, we need to mark all symbols in the same comdat group
that way. */
if (node->same_comdat_group)
- for (next = cgraph (node->same_comdat_group);
+ for (next = dyn_cast<cgraph_node *> (node->same_comdat_group);
next != node;
- next = cgraph (next->same_comdat_group))
- cgraph_for_node_and_aliases (next, clear_decl_external,
- NULL, true);
+ next = dyn_cast<cgraph_node *> (next->same_comdat_group))
+ next->call_for_symbol_thunks_and_aliases (clear_decl_external,
+ NULL, true);
}
/* If we're going to need to write this function out, and
@@ -4545,7 +4545,7 @@ cp_write_global_declarations (void)
if (!DECL_EXTERNAL (decl)
&& decl_needed_p (decl)
&& !TREE_ASM_WRITTEN (decl)
- && !cgraph_get_node (decl)->definition)
+ && !cgraph_node::get (decl)->definition)
{
/* We will output the function; no longer consider it in this
loop. */
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index e72682c9487..169f438e562 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -1038,9 +1038,8 @@ maybe_add_lambda_conv_op (tree type)
if (DECL_ONE_ONLY (statfn))
{
/* Put the thunk in the same comdat group as the call op. */
- symtab_add_to_same_comdat_group
- (cgraph_get_create_node (statfn),
- cgraph_get_create_node (callop));
+ cgraph_node::get_create (statfn)->add_to_same_comdat_group
+ (cgraph_node::get_create (callop));
}
tree body = begin_function_body ();
tree compound_stmt = begin_compound_stmt (0);
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 02c05d47747..8983e0dfa69 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -3487,8 +3487,8 @@ mangle_decl (const tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL)
{
/* Don't create an alias to an unreferenced function. */
- if (struct cgraph_node *n = cgraph_get_node (decl))
- cgraph_same_body_alias (n, alias, decl);
+ if (struct cgraph_node *n = cgraph_node::get (decl))
+ n->create_same_body_alias (alias, decl);
}
else
varpool_extra_name_alias (alias, decl);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 1fa4be8d552..e5fa0c1b9da 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -260,9 +260,9 @@ make_alias_for_thunk (tree function)
if (!flag_syntax_only)
{
struct cgraph_node *funcn, *aliasn;
- funcn = cgraph_get_node (function);
+ funcn = cgraph_node::get (function);
gcc_checking_assert (funcn);
- aliasn = cgraph_same_body_alias (funcn, alias, function);
+ aliasn = cgraph_node::create_same_body_alias (alias, function);
DECL_ASSEMBLER_NAME (function);
gcc_assert (aliasn != NULL);
}
@@ -359,13 +359,13 @@ use_thunk (tree thunk_fndecl, bool emit_p)
tree fn = function;
struct symtab_node *symbol;
- if ((symbol = symtab_get_node (function))
+ if ((symbol = symtab_node::get (function))
&& symbol->alias)
{
if (symbol->analyzed)
- fn = symtab_alias_ultimate_target (symtab_get_node (function))->decl;
+ fn = symtab_node::get (function)->ultimate_alias_target ()->decl;
else
- fn = symtab_get_node (function)->alias_target;
+ fn = symtab_node::get (function)->alias_target;
}
resolve_unique_section (fn, 0, flag_function_sections);
@@ -375,8 +375,8 @@ use_thunk (tree thunk_fndecl, bool emit_p)
/* Output the thunk into the same section as function. */
set_decl_section_name (thunk_fndecl, DECL_SECTION_NAME (fn));
- symtab_get_node (thunk_fndecl)->implicit_section
- = symtab_get_node (fn)->implicit_section;
+ symtab_node::get (thunk_fndecl)->implicit_section
+ = symtab_node::get (fn)->implicit_section;
}
}
@@ -395,14 +395,13 @@ use_thunk (tree thunk_fndecl, bool emit_p)
a = nreverse (t);
DECL_ARGUMENTS (thunk_fndecl) = a;
TREE_ASM_WRITTEN (thunk_fndecl) = 1;
- funcn = cgraph_get_node (function);
+ funcn = cgraph_node::get (function);
gcc_checking_assert (funcn);
- thunk_node = cgraph_add_thunk (funcn, thunk_fndecl, function,
- this_adjusting, fixed_offset, virtual_value,
- virtual_offset, alias);
+ thunk_node = funcn->create_thunk (thunk_fndecl, function,
+ this_adjusting, fixed_offset, virtual_value,
+ virtual_offset, alias);
if (DECL_ONE_ONLY (function))
- symtab_add_to_same_comdat_group (thunk_node,
- funcn);
+ thunk_node->add_to_same_comdat_group (funcn);
if (!this_adjusting
|| !targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index c16e163826e..3cd804780eb 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -191,7 +191,7 @@ cdtor_comdat_group (tree complete, tree base)
diff_seen = true;
}
grp_name[idx] = '\0';
- gcc_assert (diff_seen || symtab_get_node (complete)->alias);
+ gcc_assert (diff_seen || symtab_node::get (complete)->alias);
return get_identifier (grp_name);
}
@@ -287,16 +287,16 @@ maybe_thunk_body (tree fn, bool force)
else if (HAVE_COMDAT_GROUP)
{
tree comdat_group = cdtor_comdat_group (fns[1], fns[0]);
- cgraph_get_create_node (fns[0])->set_comdat_group (comdat_group);
- symtab_add_to_same_comdat_group (cgraph_get_create_node (fns[1]),
- cgraph_get_create_node (fns[0]));
- symtab_add_to_same_comdat_group (symtab_get_node (fn),
- symtab_get_node (fns[0]));
+ cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group);
+ cgraph_node::get_create (fns[1])->add_to_same_comdat_group
+ (cgraph_node::get_create (fns[0]));
+ symtab_node::get (fn)->add_to_same_comdat_group
+ (symtab_node::get (fns[0]));
if (fns[2])
/* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is
virtual, it goes into the same comdat group as well. */
- symtab_add_to_same_comdat_group (cgraph_get_create_node (fns[2]),
- symtab_get_node (fns[0]));
+ cgraph_node::get_create (fns[2])->add_to_same_comdat_group
+ (symtab_node::get (fns[0]));
TREE_PUBLIC (fn) = false;
DECL_EXTERNAL (fn) = false;
DECL_INTERFACE_KNOWN (fn) = true;
@@ -475,7 +475,7 @@ maybe_clone_body (tree fn)
name of fn was corrupted by write_mangled_name by adding *INTERNAL*
to it. By doing so, it also corrupted the comdat group. */
if (DECL_ONE_ONLY (fn))
- cgraph_get_create_node (clone)->set_comdat_group (cxx_comdat_group (clone));
+ cgraph_node::get_create (clone)->set_comdat_group (cxx_comdat_group (clone));
DECL_USE_TEMPLATE (clone) = DECL_USE_TEMPLATE (fn);
DECL_EXTERNAL (clone) = DECL_EXTERNAL (fn);
DECL_INTERFACE_KNOWN (clone) = DECL_INTERFACE_KNOWN (fn);
@@ -542,8 +542,8 @@ maybe_clone_body (tree fn)
if (can_alias
&& fns[0]
&& idx == 1
- && cgraph_same_body_alias (cgraph_get_create_node (fns[0]),
- clone, fns[0]))
+ && cgraph_node::get_create (fns[0])->create_same_body_alias
+ (clone, fns[0]))
{
alias = true;
if (DECL_ONE_ONLY (fns[0]))
@@ -552,11 +552,11 @@ maybe_clone_body (tree fn)
into the same, *[CD]5* comdat group instead of
*[CD][12]*. */
comdat_group = cdtor_comdat_group (fns[1], fns[0]);
- cgraph_get_create_node (fns[0])->set_comdat_group (comdat_group);
- if (symtab_get_node (clone)->same_comdat_group)
- symtab_remove_from_same_comdat_group (symtab_get_node (clone));
- symtab_add_to_same_comdat_group (symtab_get_node (clone),
- symtab_get_node (fns[0]));
+ cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group);
+ if (symtab_node::get (clone)->same_comdat_group)
+ symtab_node::get (clone)->remove_from_same_comdat_group ();
+ symtab_node::get (clone)->add_to_same_comdat_group
+ (symtab_node::get (fns[0]));
}
}
@@ -568,9 +568,8 @@ maybe_clone_body (tree fn)
/* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is
virtual, it goes into the same comdat group as well. */
if (comdat_group)
- symtab_add_to_same_comdat_group
- (cgraph_get_create_node (clone),
- symtab_get_node (fns[0]));
+ cgraph_node::get_create (clone)->add_to_same_comdat_group
+ (symtab_node::get (fns[0]));
}
else if (alias)
/* No need to populate body. */ ;
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index e7823663f5e..f6c5693df5f 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -4031,7 +4031,7 @@ cp_fix_function_decl_p (tree decl)
&& !DECL_THUNK_P (decl)
&& !DECL_EXTERNAL (decl))
{
- struct cgraph_node *node = cgraph_get_node (decl);
+ struct cgraph_node *node = cgraph_node::get (decl);
/* Don't fix same_body aliases. Although they don't have their own
CFG, they share it with what they alias to. */
diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c
index f69e6bb3c95..09e6730b37c 100644
--- a/gcc/cp/vtable-class-hierarchy.c
+++ b/gcc/cp/vtable-class-hierarchy.c
@@ -1186,7 +1186,7 @@ vtv_generate_init_routine (void)
DECL_STATIC_CONSTRUCTOR (vtv_fndecl) = 0;
gimplify_function_tree (vtv_fndecl);
- cgraph_add_new_function (vtv_fndecl, false);
+ cgraph_node::add_new_function (vtv_fndecl, false);
cgraph_process_new_functions ();
@@ -1248,7 +1248,7 @@ vtable_find_or_create_map_decl (tree base_type)
we can find and protect them. */
set_decl_section_name (var_decl, ".vtable_map_vars");
- symtab_get_node (var_decl)->implicit_section = true;
+ symtab_node::get (var_decl)->implicit_section = true;
DECL_INITIAL (var_decl) = initial_value;
comdat_linkage (var_decl);