aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.h
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-09-23 18:54:34 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-09-23 16:54:34 +0000
commit450ad0cd441aa2da250c2ca84e8005cb3a2d38e3 (patch)
treeaa313df8c645e4e1d249c3df18ae10900ad40a7e /gcc/ipa-utils.h
parentdfff7c46929d43dac828cd232c231dcb5bd7653a (diff)
downloadgcc-450ad0cd441aa2da250c2ca84e8005cb3a2d38e3.zip
gcc-450ad0cd441aa2da250c2ca84e8005cb3a2d38e3.tar.gz
gcc-450ad0cd441aa2da250c2ca84e8005cb3a2d38e3.tar.bz2
ipa-cp.c (ipa_get_indirect_edge_target_1): Add sanity check for ipa-devirt.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Add sanity check for ipa-devirt. * ipa-utils.h (possible_polymorphic_call_target_p): New function. * ipa-devirt.c (possible_polymorphic_call_target_p): Be tolerant of external calls * gimple-fold.c: Include ipa-utils.h and gimple-pretty-print.h (gimple_fold_call): Dump inconsistent devirtualizations; add sanity check for type based devirtualizations. * ipa-prop.c: Include ipa-utils.h (ipa_intraprocedural_devirtualization): Add sanity check. (try_make_edge_direct_virtual_call): Likewise. From-SVN: r202837
Diffstat (limited to 'gcc/ipa-utils.h')
-rw-r--r--gcc/ipa-utils.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h
index d6f390d..27949e1 100644
--- a/gcc/ipa-utils.h
+++ b/gcc/ipa-utils.h
@@ -108,6 +108,19 @@ possible_polymorphic_call_target_p (struct cgraph_edge *e,
return possible_polymorphic_call_target_p (e->indirect_info->otr_type,
e->indirect_info->otr_token, n);
}
+
+/* Return true if N can be possibly target of a polymorphic call of
+ OBJ_TYPE_REF expression CALL. */
+
+inline bool
+possible_polymorphic_call_target_p (tree call,
+ struct cgraph_node *n)
+{
+ return possible_polymorphic_call_target_p (obj_type_ref_class (call),
+ tree_low_cst
+ (OBJ_TYPE_REF_TOKEN (call), 1),
+ n);
+}
#endif /* GCC_IPA_UTILS_H */