aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.h
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-09-25 21:52:20 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-09-25 19:52:20 +0000
commitaa803cc76ee6a0a4f951b20912def90880c996c1 (patch)
tree737b851b74e90c187fd6b46491fa387a8085db27 /gcc/ipa-utils.h
parent2f28755fbfdd89b016163e72fa92edb14a19e5e6 (diff)
downloadgcc-aa803cc76ee6a0a4f951b20912def90880c996c1.zip
gcc-aa803cc76ee6a0a4f951b20912def90880c996c1.tar.gz
gcc-aa803cc76ee6a0a4f951b20912def90880c996c1.tar.bz2
ipa-utils.h (subbinfo_with_vtable_at_offset, [...]): Declare.
* ipa-utils.h (subbinfo_with_vtable_at_offset, type_all_derivations_known_p, type_known_to_have_no_deriavations_p, types_must_be_same_for_odr, types_odr_comparable): Declare. (polymorphic_type_binfo_p): Move here from ipa-devirt.c * ipa-polymorphic-call.c: New file. (contains_polymorphic_type_p, possible_placement_new, ipa_polymorphic_call_context::restrict_to_inner_class, contains_type_p, decl_maybe_in_construction_p, ipa_polymorphic_call_context::stream_out, ipa_polymorphic_call_context::debug, ipa_polymorphic_call_context::stream_in, ipa_polymorphic_call_context::set_by_decl, ipa_polymorphic_call_context::set_by_invariant, walk_ssa_copies, ipa_polymorphic_call_context::ipa_polymorphic_call_context, type_change_info, noncall_stmt_may_be_vtbl_ptr_store, extr_type_from_vtbl_ptr_store, record_known_type check_stmt_for_type_change, ipa_polymorphic_call_context::get_dynamic_type): Move here from ipa-devirt.c * ipa-devirt.c: No longer include data-streamer.h, lto-streamer.h and streamer-hooks.h (contains_polymorphic_type_p, possible_placement_new, ipa_polymorphic_call_context::restrict_to_inner_class, contains_type_p, decl_maybe_in_construction_p, ipa_polymorphic_call_context::stream_out, ipa_polymorphic_call_context::debug, ipa_polymorphic_call_context::stream_in, ipa_polymorphic_call_context::set_by_decl, ipa_polymorphic_call_context::set_by_invariant, walk_ssa_copies, ipa_polymorphic_call_context::ipa_polymorphic_call_context, type_change_info, noncall_stmt_may_be_vtbl_ptr_store, extr_type_from_vtbl_ptr_store, record_known_type check_stmt_for_type_change, ipa_polymorphic_call_context::get_dynamic_type): Move to ipa-polymorphic-call.c (type_all_derivations_known_p, types_odr_comparable, types_must_be_same_for_odr): Export. (type_known_to_have_no_deriavations_p): New function. * Makefile.in: Add ipa-polymorphic-call.c From-SVN: r215615
Diffstat (limited to 'gcc/ipa-utils.h')
-rw-r--r--gcc/ipa-utils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h
index 494397b..029f39a 100644
--- a/gcc/ipa-utils.h
+++ b/gcc/ipa-utils.h
@@ -74,9 +74,14 @@ tree method_class_type (const_tree);
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);
/* Return vector containing possible targets of polymorphic call E.
If COMPLETEP is non-NULL, store true if the list is complette.
@@ -162,6 +167,21 @@ odr_type_p (const_tree t)
return (TYPE_NAME (t)
&& (DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (t))));
}
+
+/* Return true if BINFO corresponds to a type with virtual methods.
+
+ Every type has several BINFOs. One is the BINFO associated by the type
+ while other represents bases of derived types. The BINFOs representing
+ bases do not have BINFO_VTABLE pointer set when this is the single
+ inheritance (because vtables are shared). Look up the BINFO of type
+ and check presence of its vtable. */
+
+inline bool
+polymorphic_type_binfo_p (const_tree binfo)
+{
+ /* See if BINFO's type has an virtual table associtated with it. */
+ return BINFO_VTABLE (TYPE_BINFO (BINFO_TYPE (binfo)));
+}
#endif /* GCC_IPA_UTILS_H */