Commit 0fa1f9b7 by Martin Jambor Committed by Martin Jambor

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
parent a358e188
2011-04-12 Martin Jambor <mjambor@suse.cz> 2011-04-12 Martin Jambor <mjambor@suse.cz>
* 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.
2011-04-12 Martin Jambor <mjambor@suse.cz>
* class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node * class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node
instead of cgraph_node. instead of cgraph_node.
* decl2.c (cxx_callgraph_analyze_expr): Likewise. * decl2.c (cxx_callgraph_analyze_expr): Likewise.
......
...@@ -8401,7 +8401,7 @@ cp_fold_obj_type_ref (tree ref, tree known_type) ...@@ -8401,7 +8401,7 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
DECL_VINDEX (fndecl))); DECL_VINDEX (fndecl)));
#endif #endif
cgraph_get_create_node (fndecl)->local.vtable_method = true; cgraph_get_node (fndecl)->local.vtable_method = true;
return build_address (fndecl); return build_address (fndecl);
} }
......
...@@ -3893,7 +3893,7 @@ cp_write_global_declarations (void) ...@@ -3893,7 +3893,7 @@ cp_write_global_declarations (void)
if (!DECL_EXTERNAL (decl) if (!DECL_EXTERNAL (decl)
&& decl_needed_p (decl) && decl_needed_p (decl)
&& !TREE_ASM_WRITTEN (decl) && !TREE_ASM_WRITTEN (decl)
&& !cgraph_get_create_node (decl)->local.finalized) && !cgraph_get_node (decl)->local.finalized)
{ {
/* We will output the function; no longer consider it in this /* We will output the function; no longer consider it in this
loop. */ loop. */
......
...@@ -259,9 +259,10 @@ make_alias_for_thunk (tree function) ...@@ -259,9 +259,10 @@ make_alias_for_thunk (tree function)
if (!flag_syntax_only) if (!flag_syntax_only)
{ {
struct cgraph_node *aliasn; struct cgraph_node *funcn, *aliasn;
aliasn = cgraph_same_body_alias (cgraph_get_create_node (function), funcn = cgraph_get_node (function);
alias, function); gcc_checking_assert (funcn);
aliasn = cgraph_same_body_alias (funcn, alias, function);
DECL_ASSEMBLER_NAME (function); DECL_ASSEMBLER_NAME (function);
gcc_assert (aliasn != NULL); gcc_assert (aliasn != NULL);
} }
...@@ -280,6 +281,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) ...@@ -280,6 +281,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
tree virtual_offset; tree virtual_offset;
HOST_WIDE_INT fixed_offset, virtual_value; HOST_WIDE_INT fixed_offset, virtual_value;
bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl); bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl);
struct cgraph_node *funcn;
/* We should have called finish_thunk to give it a name. */ /* We should have called finish_thunk to give it a name. */
gcc_assert (DECL_NAME (thunk_fndecl)); gcc_assert (DECL_NAME (thunk_fndecl));
...@@ -379,7 +381,9 @@ use_thunk (tree thunk_fndecl, bool emit_p) ...@@ -379,7 +381,9 @@ use_thunk (tree thunk_fndecl, bool emit_p)
a = nreverse (t); a = nreverse (t);
DECL_ARGUMENTS (thunk_fndecl) = a; DECL_ARGUMENTS (thunk_fndecl) = a;
TREE_ASM_WRITTEN (thunk_fndecl) = 1; 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, this_adjusting, fixed_offset, virtual_value,
virtual_offset, alias); virtual_offset, alias);
......
...@@ -309,8 +309,9 @@ maybe_clone_body (tree fn) ...@@ -309,8 +309,9 @@ maybe_clone_body (tree fn)
&& (!DECL_ONE_ONLY (fns[0]) && (!DECL_ONE_ONLY (fns[0])
|| (HAVE_COMDAT_GROUP || (HAVE_COMDAT_GROUP
&& DECL_WEAK (fns[0]))) && DECL_WEAK (fns[0])))
&& cgraph_same_body_alias (cgraph_get_create_node (fns[0]), clone, && (flag_syntax_only
fns[0])) || cgraph_same_body_alias (cgraph_get_node (fns[0]), clone,
fns[0])))
{ {
alias = true; alias = true;
if (DECL_ONE_ONLY (fns[0])) if (DECL_ONE_ONLY (fns[0]))
...@@ -424,8 +425,8 @@ maybe_clone_body (tree fn) ...@@ -424,8 +425,8 @@ maybe_clone_body (tree fn)
/* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is /* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is
virtual, it goes into the same comdat group as well. */ virtual, it goes into the same comdat group as well. */
DECL_COMDAT_GROUP (fns[2]) = comdat_group; DECL_COMDAT_GROUP (fns[2]) = comdat_group;
base_dtor_node = cgraph_get_create_node (fns[0]); base_dtor_node = cgraph_get_node (fns[0]);
deleting_dtor_node = cgraph_get_create_node (fns[2]); deleting_dtor_node = cgraph_get_node (fns[2]);
gcc_assert (base_dtor_node->same_comdat_group == NULL); gcc_assert (base_dtor_node->same_comdat_group == NULL);
gcc_assert (deleting_dtor_node->same_comdat_group == NULL); gcc_assert (deleting_dtor_node->same_comdat_group == NULL);
base_dtor_node->same_comdat_group = deleting_dtor_node; base_dtor_node->same_comdat_group = deleting_dtor_node;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment