From 0e1474e5a6b808f10e251e2e1f3519f9f291d093 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 22 Aug 2013 11:32:07 +0200 Subject: * cgraphunit.c (analyze_functions) Use update_type_inheritance_graph. * ipa-utils.h (update_type_inheritance_graph): Declare. (possible_polymorphic_call_target_p): Declare. (possible_polymorphic_call_target_p): New. * ipa-devirt.c: Update toplevel comments. (cached_polymorphic_call_targets): Move up. (odr_type_d): Move ID down. (polymorphic_type_binfo_p): Update comment. (odr_hasher::remove): Likewise; (get_odr_type): Set anonymous_namespace. (dump_odr_type): Dump it. (dump_type_inheritance_graph): Do not ICE when there are no ODR types. (maybe_record_node): Record node in cached_polymorphic_call_targets. (record_binfo): Add comment. (free_polymorphic_call_targets_hash): Do not ICE when cache is not built. (devirt_node_removal_hook): Do not iCE when cache is freed. (possible_polymorphic_call_target_p): New predicate. (update_type_inheritance_graph): New function. From-SVN: r201917 --- gcc/ipa-utils.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gcc/ipa-utils.h') diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index f35ddb5..3c6c93c 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -50,12 +50,15 @@ tree get_base_var (tree); struct odr_type_d; typedef odr_type_d *odr_type; void build_type_inheritance_graph (void); +void update_type_inheritance_graph (void); vec possible_polymorphic_call_targets (tree, HOST_WIDE_INT, bool *final = NULL, void **cache_token = NULL); odr_type get_odr_type (tree, bool insert = false); void dump_possible_polymorphic_call_targets (FILE *, tree, HOST_WIDE_INT); +bool possible_polymorphic_call_target_p (tree, HOST_WIDE_INT, + struct cgraph_node *n); /* Return vector containing possible targets of polymorphic call E. If FINALP is non-NULL, store true if the list is complette. @@ -87,6 +90,17 @@ dump_possible_polymorphic_call_targets (FILE *f, struct cgraph_edge *e) dump_possible_polymorphic_call_targets (f, e->indirect_info->otr_type, e->indirect_info->otr_token); } + +/* Return true if N can be possibly target of a polymorphic call of + E. */ + +inline bool +possible_polymorphic_call_target_p (struct cgraph_edge *e, + struct cgraph_node *n) +{ + return possible_polymorphic_call_target_p (e->indirect_info->otr_type, + e->indirect_info->otr_token, n); +} #endif /* GCC_IPA_UTILS_H */ -- cgit v1.1