123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- #ifndef GCC_IPA_UTILS_H
- #define GCC_IPA_UTILS_H
- struct ipa_dfs_info {
- int dfn_number;
- int low_link;
-
- int scc_no;
- bool new_node;
- bool on_stack;
- struct cgraph_node* next_cycle;
- PTR aux;
- };
- void ipa_print_order (FILE*, const char *, struct cgraph_node**, int);
- int ipa_reduced_postorder (struct cgraph_node **, bool, bool,
- bool (*ignore_edge) (struct cgraph_edge *));
- void ipa_free_postorder_info (void);
- vec<cgraph_node *> ipa_get_nodes_in_cycle (struct cgraph_node *);
- bool ipa_edge_within_scc (struct cgraph_edge *);
- int ipa_reverse_postorder (struct cgraph_node **);
- tree get_base_var (tree);
- void ipa_merge_profiles (struct cgraph_node *dst,
- struct cgraph_node *src, bool preserve_body = false);
- bool recursive_call_p (tree, tree);
- bool ipa_propagate_frequency (struct cgraph_node *node);
- struct odr_type_d;
- typedef odr_type_d *odr_type;
- void build_type_inheritance_graph (void);
- void update_type_inheritance_graph (void);
- vec <cgraph_node *>
- possible_polymorphic_call_targets (tree, HOST_WIDE_INT,
- ipa_polymorphic_call_context,
- bool *copletep = NULL,
- void **cache_token = NULL,
- bool speuclative = false);
- odr_type get_odr_type (tree, bool insert = false);
- bool possible_polymorphic_call_target_p (tree ref, gimple stmt, struct cgraph_node *n);
- void dump_possible_polymorphic_call_targets (FILE *, tree, HOST_WIDE_INT,
- const ipa_polymorphic_call_context &);
- bool possible_polymorphic_call_target_p (tree, HOST_WIDE_INT,
- const ipa_polymorphic_call_context &,
- struct cgraph_node *);
- tree method_class_type (const_tree);
- tree inlined_polymorphic_ctor_dtor_block_p (tree, bool);
- 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 *);
- tree subbinfo_with_vtable_at_offset (tree, unsigned HOST_WIDE_INT, tree);
- void compare_virtual_tables (varpool_node *, varpool_node *);
- bool type_all_derivations_known_p (const_tree);
- bool type_known_to_have_no_deriavations_p (tree);
- bool contains_polymorphic_type_p (const_tree);
- void register_odr_type (tree);
- bool types_must_be_same_for_odr (tree, tree);
- bool types_odr_comparable (tree, tree, bool strict = false);
- cgraph_node *try_speculative_devirtualization (tree, HOST_WIDE_INT,
- ipa_polymorphic_call_context);
- inline vec <cgraph_node *>
- possible_polymorphic_call_targets (struct cgraph_edge *e,
- bool *completep = NULL,
- void **cache_token = NULL,
- bool speculative = false)
- {
- ipa_polymorphic_call_context context(e);
- return possible_polymorphic_call_targets (e->indirect_info->otr_type,
- e->indirect_info->otr_token,
- context,
- completep, cache_token,
- speculative);
- }
- inline vec <cgraph_node *>
- possible_polymorphic_call_targets (tree ref,
- gimple call,
- bool *completep = NULL,
- void **cache_token = NULL)
- {
- ipa_polymorphic_call_context context (current_function_decl, ref, call);
- return possible_polymorphic_call_targets (obj_type_ref_class (ref),
- tree_to_uhwi
- (OBJ_TYPE_REF_TOKEN (ref)),
- context,
- completep, cache_token);
- }
- inline void
- dump_possible_polymorphic_call_targets (FILE *f, struct cgraph_edge *e)
- {
- ipa_polymorphic_call_context context(e);
- dump_possible_polymorphic_call_targets (f, e->indirect_info->otr_type,
- e->indirect_info->otr_token,
- context);
- }
- inline bool
- possible_polymorphic_call_target_p (struct cgraph_edge *e,
- struct cgraph_node *n)
- {
- ipa_polymorphic_call_context context(e);
- return possible_polymorphic_call_target_p (e->indirect_info->otr_type,
- e->indirect_info->otr_token,
- context, n);
- }
- static inline bool
- odr_type_p (const_tree t)
- {
- if (type_in_anonymous_namespace_p (t))
- return true;
-
- gcc_assert (in_lto_p || flag_lto);
- return (TYPE_NAME (t)
- && (DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (t))));
- }
- inline bool
- polymorphic_type_binfo_p (const_tree binfo)
- {
-
- return (BINFO_TYPE (binfo) && TYPE_BINFO (BINFO_TYPE (binfo))
- && BINFO_VTABLE (TYPE_BINFO (BINFO_TYPE (binfo))));
- }
- #endif
|