aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2011-04-12 11:27:18 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2011-04-12 11:27:18 +0200
commita358e188450fe839855b1b10e3f0410bf8e54929 (patch)
tree2900c2e60111189ed0a91ca9e536453bdc1ea540 /gcc/cp
parentfe660d7bfe8ae31c03f500af99c1a614438d0198 (diff)
downloadgcc-a358e188450fe839855b1b10e3f0410bf8e54929.zip
gcc-a358e188450fe839855b1b10e3f0410bf8e54929.tar.gz
gcc-a358e188450fe839855b1b10e3f0410bf8e54929.tar.bz2
cgraph.h (cgraph_node): Remove function declaration.
2011-04-12 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_node): Remove function declaration. (cgraph_create_node): Declare. (cgraph_get_create_node): Likewise. * cgraph.c (cgraph_create_node): Renamed to cgraph_create_node_1. Updated all callers. (cgraph_node): Renamed to cgraph_create_node, assert that a node for the decl does not already exist. Call cgraph_get_create_node instead of cgraph_node. (cgraph_get_create_node): New function. (cgraph_same_body_alias): Update comment. (cgraph_set_call_stmt): Call cgraph_get_node instead of cgraph_node, assert it does not return NULL. (cgraph_update_edges_for_call_stmt): Likewise. (cgraph_clone_edge): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_update_edges_for_call_stmt_node): Call cgraph_get_create_node instead of cgraph_node. (cgraph_add_new_function): Call cgraph_create_node or cgraph_get_create_node instead of cgraph_node. * cgraphbuild.c (record_reference): Call cgraph_get_create_node instead of cgraph_node. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (build_cgraph_edges): Call cgraph_get_create_node instead of cgraph_node. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (cgraph_finalize_function): Call cgraph_get_create_node instead of cgraph_node. (cgraph_copy_node_for_versioning): Call cgraph_create_node instead of cgraph_node. * lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Call cgraph_create_node instead of cgraph_node. * c-decl.c (finish_function): Call cgraph_get_create_node instead of cgraph_node. * lto-cgraph.c (input_node): Likewise. * lto-streamer-in.c (input_function): Likewise. * varasm.c (mark_decl_referenced): Likewise. (assemble_alias): Likewise. gcc/c-family/ * c-gimplify.c (c_genericize): Call cgraph_get_create_node instead of cgraph_node. gcc/cp/ * cp/class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node instead of cgraph_node. * cp/decl2.c (cxx_callgraph_analyze_expr): Likewise. (cp_write_global_declarations): Likewise. * cp/optimize.c (maybe_clone_body): Likewise. * cp/semantics.c (maybe_add_lambda_conv_op): Likewise. * cp/mangle.c (mangle_decl): Likewise. * cp/method.c (make_alias_for_thunk): Likewise. (use_thunk): Likewise. gcc/ada/ * gcc-interface/utils.c (end_subprog_body): Call cgraph_get_create_node instead of cgraph_node. gcc/fortran/ * trans-decl.c (gfc_generate_function_code): Call cgraph_get_create_node instead of cgraph_node. gcc/objc/ * objc-act.c (mark_referenced_methods): Call cgraph_get_create_node instead of cgraph_node. From-SVN: r172307
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/decl2.c8
-rw-r--r--gcc/cp/mangle.c2
-rw-r--r--gcc/cp/method.c7
-rw-r--r--gcc/cp/optimize.c7
-rw-r--r--gcc/cp/semantics.c4
7 files changed, 29 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bf7113f..f9c0fb2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,15 @@
+2011-04-12 Martin Jambor <mjambor@suse.cz>
+
+ * class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node
+ instead of cgraph_node.
+ * decl2.c (cxx_callgraph_analyze_expr): Likewise.
+ (cp_write_global_declarations): Likewise.
+ * optimize.c (maybe_clone_body): Likewise.
+ * semantics.c (maybe_add_lambda_conv_op): Likewise.
+ * mangle.c (mangle_decl): Likewise.
+ * method.c (make_alias_for_thunk): Likewise.
+ (use_thunk): Likewise.
+
2011-04-11 Jason Merrill <jason@redhat.com>
PR c++/48535
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 24b8a31..634b2bf 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -8401,7 +8401,7 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
DECL_VINDEX (fndecl)));
#endif
- cgraph_node (fndecl)->local.vtable_method = true;
+ cgraph_get_create_node (fndecl)->local.vtable_method = true;
return build_address (fndecl);
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f62f913..9e63c87 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3374,11 +3374,13 @@ cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED)
{
case PTRMEM_CST:
if (TYPE_PTRMEMFUNC_P (TREE_TYPE (t)))
- cgraph_mark_address_taken_node (cgraph_node (PTRMEM_CST_MEMBER (t)));
+ cgraph_mark_address_taken_node (
+ cgraph_get_create_node (PTRMEM_CST_MEMBER (t)));
break;
case BASELINK:
if (TREE_CODE (BASELINK_FUNCTIONS (t)) == FUNCTION_DECL)
- cgraph_mark_address_taken_node (cgraph_node (BASELINK_FUNCTIONS (t)));
+ cgraph_mark_address_taken_node (
+ cgraph_get_create_node (BASELINK_FUNCTIONS (t)));
break;
case VAR_DECL:
if (DECL_CONTEXT (t)
@@ -3891,7 +3893,7 @@ cp_write_global_declarations (void)
if (!DECL_EXTERNAL (decl)
&& decl_needed_p (decl)
&& !TREE_ASM_WRITTEN (decl)
- && !cgraph_node (decl)->local.finalized)
+ && !cgraph_get_create_node (decl)->local.finalized)
{
/* We will output the function; no longer consider it in this
loop. */
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index f063d47..b33f317 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -3170,7 +3170,7 @@ mangle_decl (const tree decl)
if (vague_linkage_p (decl))
DECL_WEAK (alias) = 1;
if (TREE_CODE (decl) == FUNCTION_DECL)
- cgraph_same_body_alias (cgraph_node (decl), alias, decl);
+ cgraph_same_body_alias (cgraph_get_create_node (decl), alias, decl);
else
varpool_extra_name_alias (alias, decl);
#endif
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index b741516..e18143e2 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -259,8 +259,9 @@ make_alias_for_thunk (tree function)
if (!flag_syntax_only)
{
- struct cgraph_node *aliasn = cgraph_same_body_alias (cgraph_node (function),
- alias, function);
+ struct cgraph_node *aliasn;
+ aliasn = cgraph_same_body_alias (cgraph_get_create_node (function),
+ alias, function);
DECL_ASSEMBLER_NAME (function);
gcc_assert (aliasn != NULL);
}
@@ -378,7 +379,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
a = nreverse (t);
DECL_ARGUMENTS (thunk_fndecl) = a;
TREE_ASM_WRITTEN (thunk_fndecl) = 1;
- cgraph_add_thunk (cgraph_node (function), thunk_fndecl, function,
+ cgraph_add_thunk (cgraph_get_create_node (function), thunk_fndecl, function,
this_adjusting, fixed_offset, virtual_value,
virtual_offset, alias);
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 2ce9838..2110779 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -309,7 +309,8 @@ maybe_clone_body (tree fn)
&& (!DECL_ONE_ONLY (fns[0])
|| (HAVE_COMDAT_GROUP
&& DECL_WEAK (fns[0])))
- && cgraph_same_body_alias (cgraph_node (fns[0]), clone, fns[0]))
+ && cgraph_same_body_alias (cgraph_get_create_node (fns[0]), clone,
+ fns[0]))
{
alias = true;
if (DECL_ONE_ONLY (fns[0]))
@@ -423,8 +424,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. */
DECL_COMDAT_GROUP (fns[2]) = comdat_group;
- base_dtor_node = cgraph_node (fns[0]);
- deleting_dtor_node = cgraph_node (fns[2]);
+ base_dtor_node = cgraph_get_create_node (fns[0]);
+ deleting_dtor_node = cgraph_get_create_node (fns[2]);
gcc_assert (base_dtor_node->same_comdat_group == NULL);
gcc_assert (deleting_dtor_node->same_comdat_group == NULL);
base_dtor_node->same_comdat_group = deleting_dtor_node;
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 61d87be..8752f37 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -8458,8 +8458,8 @@ maybe_add_lambda_conv_op (tree type)
/* Put the thunk in the same comdat group as the call op. */
struct cgraph_node *callop_node, *thunk_node;
DECL_COMDAT_GROUP (statfn) = DECL_COMDAT_GROUP (callop);
- callop_node = cgraph_node (callop);
- thunk_node = cgraph_node (statfn);
+ callop_node = cgraph_get_create_node (callop);
+ thunk_node = cgraph_get_create_node (statfn);
gcc_assert (callop_node->same_comdat_group == NULL);
gcc_assert (thunk_node->same_comdat_group == NULL);
callop_node->same_comdat_group = thunk_node;