Commit f1724940 by Jan Hubicka Committed by Jan Hubicka

ipa-cp.c (ipcp_process_devirtualization_opportunities): Update call of…

ipa-cp.c (ipcp_process_devirtualization_opportunities): Update call of gimple_get_virt_method_for_binfo.

	* ipa-cp.c (ipcp_process_devirtualization_opportunities):
	Update call of gimple_get_virt_method_for_binfo.
	* gimple-fold.c (gimple_get_virt_method_for_binfo): Remove
	refuse_thunks parameter.
	(gimple_fold_call): Update.
	* ipa-prop.c (try_make_edge_direct_virtual_call): Update.

From-SVN: r174905
parent a6f834c5
2011-06-10 Jan Hubicka <jh@suse.cz> 2011-06-10 Jan Hubicka <jh@suse.cz>
* ipa-cp.c (ipcp_process_devirtualization_opportunities):
Update call of gimple_get_virt_method_for_binfo.
* gimple-fold.c (gimple_get_virt_method_for_binfo): Remove
refuse_thunks parameter.
(gimple_fold_call): Update.
* ipa-prop.c (try_make_edge_direct_virtual_call): Update.
2011-06-10 Jan Hubicka <jh@suse.cz>
* tree-sra.c (all_callers_have_enough_arguments_p): Rename to ... * tree-sra.c (all_callers_have_enough_arguments_p): Rename to ...
(not_all_callers_have_enough_arguments_p): ... this one; turn into (not_all_callers_have_enough_arguments_p): ... this one; turn into
worker for cgraph_for_node_and_aliases. worker for cgraph_for_node_and_aliases.
......
...@@ -1373,11 +1373,10 @@ gimple_fold_builtin (gimple stmt) ...@@ -1373,11 +1373,10 @@ gimple_fold_builtin (gimple stmt)
tree tree
gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo, gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo,
tree *delta, bool refuse_thunks) tree *delta)
{ {
HOST_WIDE_INT i; HOST_WIDE_INT i;
tree v, fndecl; tree v, fndecl;
struct cgraph_node *node;
v = BINFO_VIRTUALS (known_binfo); v = BINFO_VIRTUALS (known_binfo);
/* If there is no virtual methods leave the OBJ_TYPE_REF alone. */ /* If there is no virtual methods leave the OBJ_TYPE_REF alone. */
...@@ -1396,18 +1395,6 @@ gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo, ...@@ -1396,18 +1395,6 @@ gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo,
return NULL_TREE; return NULL_TREE;
fndecl = TREE_VALUE (v); fndecl = TREE_VALUE (v);
node = cgraph_get_node_or_alias (fndecl);
if (refuse_thunks
&& (!node
/* Bail out if it is a thunk declaration. Since simple this_adjusting
thunks are represented by a constant in TREE_PURPOSE of items in
BINFO_VIRTUALS, this is a more complicate type which we cannot handle as
yet.
FIXME: Remove the following condition once we are able to represent
thunk information on call graph edges. */
|| (node->same_body_alias && node->thunk.thunk_p)))
return NULL_TREE;
/* When cgraph node is missing and function is not public, we cannot /* When cgraph node is missing and function is not public, we cannot
devirtualize. This can happen in WHOPR when the actual method devirtualize. This can happen in WHOPR when the actual method
...@@ -1557,7 +1544,7 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace) ...@@ -1557,7 +1544,7 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
if (!binfo) if (!binfo)
return false; return false;
token = TREE_INT_CST_LOW (OBJ_TYPE_REF_TOKEN (callee)); token = TREE_INT_CST_LOW (OBJ_TYPE_REF_TOKEN (callee));
fndecl = gimple_get_virt_method_for_binfo (token, binfo, &delta, false); fndecl = gimple_get_virt_method_for_binfo (token, binfo, &delta);
if (!fndecl) if (!fndecl)
return false; return false;
gcc_assert (integer_zerop (delta)); gcc_assert (integer_zerop (delta));
......
...@@ -904,7 +904,7 @@ unsigned get_gimple_rhs_num_ops (enum tree_code); ...@@ -904,7 +904,7 @@ unsigned get_gimple_rhs_num_ops (enum tree_code);
gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL); gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
const char *gimple_decl_printable_name (tree, int); const char *gimple_decl_printable_name (tree, int);
bool gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace); bool gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace);
tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree, tree *, bool); tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree, tree *);
void gimple_adjust_this_by_delta (gimple_stmt_iterator *, tree); void gimple_adjust_this_by_delta (gimple_stmt_iterator *, tree);
tree gimple_extract_devirt_binfo_from_cst (tree); tree gimple_extract_devirt_binfo_from_cst (tree);
/* Returns true iff T is a valid GIMPLE statement. */ /* Returns true iff T is a valid GIMPLE statement. */
......
...@@ -1190,8 +1190,7 @@ ipcp_process_devirtualization_opportunities (struct cgraph_node *node) ...@@ -1190,8 +1190,7 @@ ipcp_process_devirtualization_opportunities (struct cgraph_node *node)
binfo = get_binfo_at_offset (binfo, anc_offset, otr_type); binfo = get_binfo_at_offset (binfo, anc_offset, otr_type);
if (!binfo) if (!binfo)
continue; continue;
target = gimple_get_virt_method_for_binfo (token, binfo, &delta, target = gimple_get_virt_method_for_binfo (token, binfo, &delta);
false);
} }
else else
{ {
...@@ -1214,7 +1213,7 @@ ipcp_process_devirtualization_opportunities (struct cgraph_node *node) ...@@ -1214,7 +1213,7 @@ ipcp_process_devirtualization_opportunities (struct cgraph_node *node)
break; break;
} }
t = gimple_get_virt_method_for_binfo (token, binfo, &d, true); t = gimple_get_virt_method_for_binfo (token, binfo, &d);
if (!t) if (!t)
{ {
target = NULL_TREE; target = NULL_TREE;
......
...@@ -1771,7 +1771,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie, ...@@ -1771,7 +1771,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
type = ie->indirect_info->otr_type; type = ie->indirect_info->otr_type;
binfo = get_binfo_at_offset (binfo, ie->indirect_info->anc_offset, type); binfo = get_binfo_at_offset (binfo, ie->indirect_info->anc_offset, type);
if (binfo) if (binfo)
target = gimple_get_virt_method_for_binfo (token, binfo, &delta, true); target = gimple_get_virt_method_for_binfo (token, binfo, &delta);
else else
return NULL; return NULL;
......
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