aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-polymorphic-call.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-05-19 23:02:06 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-05-19 21:02:06 +0000
commit4d6eb35a6dbe6c9808779ca446667f8a8374a11b (patch)
tree931fdcb291847f90f2d4c69e3f993bf2c4cd3d2e /gcc/ipa-polymorphic-call.c
parent296a8c2f54dd8bf2f84c687db8329f179774220e (diff)
downloadgcc-4d6eb35a6dbe6c9808779ca446667f8a8374a11b.zip
gcc-4d6eb35a6dbe6c9808779ca446667f8a8374a11b.tar.gz
gcc-4d6eb35a6dbe6c9808779ca446667f8a8374a11b.tar.bz2
ipa-devirt.c (type_in_anonymous_namespace_p): Return true or implicit declarations.
* ipa-devirt.c (type_in_anonymous_namespace_p): Return true or implicit declarations. (odr_type_p): Check that TYPE_NAME is TYPE_DECL before looking into it. (get_odr_type): Check type has linkage before adding bases. (register_odr_type): Check that type has linkage before adding it. (type_known_to_have_no_deriavations_p): Rename to .. (type_known_to_have_no_derivations_p): This one. * ipa-utils.h (type_known_to_have_no_deriavations_p): Rename to .. (type_known_to_have_no_derivations_p): This one. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::restrict_to_inner_type): Check that type has linkage. From-SVN: r223415
Diffstat (limited to 'gcc/ipa-polymorphic-call.c')
-rw-r--r--gcc/ipa-polymorphic-call.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index 41d5687..083648d 100644
--- a/gcc/ipa-polymorphic-call.c
+++ b/gcc/ipa-polymorphic-call.c
@@ -269,7 +269,8 @@ ipa_polymorphic_call_context::restrict_to_inner_class (tree otr_type,
types. Testing it here may help us to avoid speculation. */
if (otr_type && TREE_CODE (outer_type) == RECORD_TYPE
&& (!in_lto_p || odr_type_p (outer_type))
- && type_known_to_have_no_deriavations_p (outer_type))
+ && type_with_linkage_p (outer_type)
+ && type_known_to_have_no_derivations_p (outer_type))
maybe_derived_type = false;
/* Type can not contain itself on an non-zero offset. In that case
@@ -393,7 +394,7 @@ ipa_polymorphic_call_context::restrict_to_inner_class (tree otr_type,
goto no_useful_type_info;
cur_offset = new_offset;
- type = subtype;
+ type = TYPE_MAIN_VARIANT (subtype);
if (!speculative)
{
outer_type = type;