aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.h
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-09-12 01:16:42 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-09-11 23:16:42 +0000
commit1ee85ee19b06863781374b7c9f97e4f6e931118b (patch)
tree5ca60267bac44557141301c497a4c5364a3466f9 /gcc/ipa-utils.h
parentbc9132dee6c4a8a4348a15ad62772d632351388b (diff)
downloadgcc-1ee85ee19b06863781374b7c9f97e4f6e931118b.zip
gcc-1ee85ee19b06863781374b7c9f97e4f6e931118b.tar.gz
gcc-1ee85ee19b06863781374b7c9f97e4f6e931118b.tar.bz2
common.opt (flto-odr-type-merging): New flag.
* common.opt (flto-odr-type-merging): New flag. * ipa-deivrt.c (hash_type_name): Use ODR names for hasing if availale. (types_same_for_odr): Likewise. (odr_subtypes_equivalent_p): Likewise. (add_type_duplicate): Do not walk type variants. (register_odr_type): New function. * ipa-utils.h (register_odr_type): Declare. (odr_type_p): New function. * langhooks.c (lhd_set_decl_assembler_name): Do not compute TYPE_DECLs * doc/invoke.texi (-flto-odr-type-merging): Document. * tree.c (need_assembler_name_p): Compute ODR names when asked for it. * tree.h (DECL_ASSEMBLER_NAME): Update comment. * lto.c (lto_read_decls): Register ODR types. From-SVN: r215196
Diffstat (limited to 'gcc/ipa-utils.h')
-rw-r--r--gcc/ipa-utils.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h
index d4980eb..9c81d5c 100644
--- a/gcc/ipa-utils.h
+++ b/gcc/ipa-utils.h
@@ -152,6 +152,7 @@ tree vtable_pointer_value_to_binfo (const_tree);
bool vtable_pointer_value_to_vtable (const_tree, tree *, unsigned HOST_WIDE_INT *);
void compare_virtual_tables (varpool_node *, varpool_node *);
bool contains_polymorphic_type_p (const_tree);
+void register_odr_type (tree);
/* Return vector containing possible targets of polymorphic call E.
If FINALP is non-NULL, store true if the list is complette.
@@ -239,6 +240,23 @@ possible_polymorphic_call_target_p (tree call,
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))));
+}
#endif /* GCC_IPA_UTILS_H */