From 058d0a9059789682ccef8f56aa04182d71d17e78 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 5 Jul 2014 19:22:44 +0200 Subject: cgraph.c (cgraph_create_indirect_edge): Update call of get_polymorphic_call_info. * cgraph.c (cgraph_create_indirect_edge): Update call of get_polymorphic_call_info. * ipa-utils.h (get_polymorphic_call_info): Add parameter CALL. (possible_polymorphic_call_targets): Add parameter call. (decl_maybe_in_construction_p): New predicate. (get_polymorphic_call_info): Add parameter call; use decl_maybe_in_construction_p. * gimple-fold.c (fold_gimple_assign): Update use of possible_polymorphic_call_targets. (gimple_fold_call): Likewise. * ipa-prop.c: Inlcude calls.h (ipa_binfo_from_known_type_jfunc): Check that known type is record. (param_type_may_change_p): New predicate. (detect_type_change_from_memory_writes): Break out from ... (detect_type_change): ... this one; use param_type_may_change_p. (detect_type_change_ssa): Use param_type_may_change_p. (compute_known_type_jump_func): Use decl_maybe_in_construction_p. * g++.dg/ipa/devirt-26.C: Update testcase. * g++.dg/ipa/imm-devirt-1.C: Update testcase. * g++.dg/ipa/imm-devirt-2.C: Update testcase. From-SVN: r212304 --- gcc/ipa-utils.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'gcc/ipa-utils.h') diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index 82aa23f..470f495 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -87,9 +87,11 @@ bool possible_polymorphic_call_target_p (tree, HOST_WIDE_INT, tree method_class_type (const_tree); tree get_polymorphic_call_info (tree, tree, tree *, HOST_WIDE_INT *, - ipa_polymorphic_call_context *); + ipa_polymorphic_call_context *, + gimple call = NULL); bool get_polymorphic_call_info_from_invariant (ipa_polymorphic_call_context *, tree, tree, HOST_WIDE_INT); +bool decl_maybe_in_construction_p (tree, tree, gimple, tree); tree vtable_pointer_value_to_binfo (const_tree); bool vtable_pointer_value_to_vtable (const_tree, tree *, unsigned HOST_WIDE_INT *); bool contains_polymorphic_type_p (const_tree); @@ -125,7 +127,8 @@ possible_polymorphic_call_targets (struct cgraph_edge *e, /* Same as above but taking OBJ_TYPE_REF as an parameter. */ inline vec -possible_polymorphic_call_targets (tree call, +possible_polymorphic_call_targets (tree ref, + gimple call, bool *final = NULL, void **cache_token = NULL) { @@ -134,11 +137,11 @@ possible_polymorphic_call_targets (tree call, ipa_polymorphic_call_context context; get_polymorphic_call_info (current_function_decl, - call, - &otr_type, &otr_token, &context); - return possible_polymorphic_call_targets (obj_type_ref_class (call), + ref, + &otr_type, &otr_token, &context, call); + return possible_polymorphic_call_targets (obj_type_ref_class (ref), tree_to_uhwi - (OBJ_TYPE_REF_TOKEN (call)), + (OBJ_TYPE_REF_TOKEN (ref)), context, final, cache_token); } -- cgit v1.1