From e7a677ca1a53221276c0b382811c0351d381b35a Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 12 May 2015 20:30:40 +0200 Subject: ipa-devirt.c (type_with_linkage_p): New function. * ipa-devirt.c (type_with_linkage_p): New function. (type_in_anonymous_namespace_p): Move here from tree.c; assert that type has linkage. (odr_type_p): Move here from ipa-utils.h; use type_with_linkage_p. (can_be_name_hashed_p): Simplify. (hash_odr_name): Check that type has linkage before checking if it is anonymous. (types_same_for_odr): Likewise. (odr_name_hasher::equal): Likewise. (odr_subtypes_equivalent_p): Likewise. (warn_types_mismatch): Likewise. (get_odr_type): Likewise. (odr_types_equivalent_p): Fix checking of TYPE_MAIN_VARIANT. * ipa-utils.h (odr_type_p): Move offline. * tree.c (need_assembler_name_p): Fix handling of types without linkages. (type_in_anonymous_namespace_p): Move to ipa-devirt.c From-SVN: r223094 --- gcc/ipa-utils.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'gcc/ipa-utils.h') diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index 0cf6541..13c59a83 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -63,6 +63,7 @@ possible_polymorphic_call_targets (tree, HOST_WIDE_INT, void **cache_token = NULL, bool speuclative = false); odr_type get_odr_type (tree, bool insert = false); +bool odr_type_p (const_tree t); 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 &); @@ -153,23 +154,6 @@ possible_polymorphic_call_target_p (struct cgraph_edge *e, context, n); } -/* Return true of T is type with One Definition Rule info attached. - It means that either it is anonymous type or it has assembler name - set. */ - -static inline bool -odr_type_p (const_tree t) -{ - if (type_in_anonymous_namespace_p (t)) - return true; - /* We do not have this information when not in LTO, but we do not need - to care, since it is used only for type merging. */ - gcc_assert (in_lto_p || flag_lto); - - 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 -- cgit v1.1