From 6f8091fc3ed9d3cfa7a6dee7e9f9a34eb4308b2a Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 20 Sep 2014 08:22:58 +0200 Subject: ipa-utils.h (ipa_polymorphic_call_context): Turn into class; add ctors. * ipa-utils.h (ipa_polymorphic_call_context): Turn into class; add ctors. (possible_polymorphic_call_targets, dump_possible_polymorphic_call_targets, possible_polymorphic_call_target_p, possible_polymorphic_call_target_p): Simplify. (get_dynamic_type): Remove. * ipa-devirt.c (ipa_dummy_polymorphic_call_context): Remove. (clear_speculation): Bring to ipa-deivrt.h (get_class_context): Rename to ... (ipa_polymorphic_call_context::restrict_to_inner_class): ... this one. (contains_type_p): Update. (get_dynamic_type): Rename to ... ipa_polymorphic_call_context::get_dynamic_type(): ... this one. (possible_polymorphic_call_targets): UPdate. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Update. * ipa-prop.c (ipa_analyze_call_uses): Update. From-SVN: r215418 --- gcc/cgraph.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'gcc/cgraph.c') diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 99e0076..8f04284 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -884,21 +884,15 @@ cgraph_node::create_indirect_edge (gimple call_stmt, int ecf_flags, && (target = gimple_call_fn (call_stmt)) && virtual_method_call_p (target)) { - tree otr_type; - HOST_WIDE_INT otr_token; - ipa_polymorphic_call_context context; - - get_polymorphic_call_info (decl, - target, - &otr_type, &otr_token, - &context, call_stmt); + ipa_polymorphic_call_context context (decl, target, call_stmt); /* Only record types can have virtual calls. */ - gcc_assert (TREE_CODE (otr_type) == RECORD_TYPE); edge->indirect_info->polymorphic = true; edge->indirect_info->param_index = -1; - edge->indirect_info->otr_token = otr_token; - edge->indirect_info->otr_type = otr_type; + edge->indirect_info->otr_token + = tree_to_uhwi (OBJ_TYPE_REF_TOKEN (target)); + edge->indirect_info->otr_type = obj_type_ref_class (target); + gcc_assert (TREE_CODE (edge->indirect_info->otr_type) == RECORD_TYPE); edge->indirect_info->outer_type = context.outer_type; edge->indirect_info->speculative_outer_type = context.speculative_outer_type; -- cgit v1.1