diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-04-12 12:02:31 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2011-04-12 12:02:31 +0200 |
commit | 0fa1f9b76227e5f3bb22a40a356727f0c4841179 (patch) | |
tree | 25e81ab2df18f59f5d53a1d312e2195c9155fce8 /gcc/cp/method.c | |
parent | a358e188450fe839855b1b10e3f0410bf8e54929 (diff) | |
download | gcc-0fa1f9b76227e5f3bb22a40a356727f0c4841179.zip gcc-0fa1f9b76227e5f3bb22a40a356727f0c4841179.tar.gz gcc-0fa1f9b76227e5f3bb22a40a356727f0c4841179.tar.bz2 |
class.c (cp_fold_obj_type_ref): Call cgraph_get_node instead of cgraph_get_create_node.
2011-04-12 Martin Jambor <mjambor@suse.cz>
gcc/cp/
* class.c (cp_fold_obj_type_ref): Call cgraph_get_node instead of
cgraph_get_create_node.
* decl2.c (cp_write_global_declarations): Call cgraph_get_node
instead of cgraph_get_create_node.
* method.c (make_alias_for_thunk): Call cgraph_get_node
instead of cgraph_get_create_node, assert it returns non-NULL.
(use_thunk): Likewise.
* optimize.c (maybe_clone_body): Call cgraph_same_body_alias only
when flag_syntax_only is not set. Call cgraph_get_node instead of
cgraph_get_create_node.
(maybe_clone_body): Call cgraph_get_node instead of
cgraph_get_create_node.
From-SVN: r172308
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r-- | gcc/cp/method.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index e18143e2..6b26806 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -259,9 +259,10 @@ make_alias_for_thunk (tree function) if (!flag_syntax_only) { - struct cgraph_node *aliasn; - aliasn = cgraph_same_body_alias (cgraph_get_create_node (function), - alias, function); + struct cgraph_node *funcn, *aliasn; + funcn = cgraph_get_node (function); + gcc_checking_assert (funcn); + aliasn = cgraph_same_body_alias (funcn, alias, function); DECL_ASSEMBLER_NAME (function); gcc_assert (aliasn != NULL); } @@ -280,6 +281,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) tree virtual_offset; HOST_WIDE_INT fixed_offset, virtual_value; bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl); + struct cgraph_node *funcn; /* We should have called finish_thunk to give it a name. */ gcc_assert (DECL_NAME (thunk_fndecl)); @@ -379,7 +381,9 @@ 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_get_create_node (function), thunk_fndecl, function, + funcn = cgraph_get_node (function); + gcc_checking_assert (funcn); + cgraph_add_thunk (funcn, thunk_fndecl, function, this_adjusting, fixed_offset, virtual_value, virtual_offset, alias); |