aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-08-19 12:14:06 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-08-19 10:14:06 +0000
commiteefe9a995ceec7fc5ca79505e96bda214e6bd82c (patch)
tree6500dfce0eb1776cd3cf03771e785f6de3bc1607 /gcc/tree.c
parent5eb5ec2f3034a1c62262914b090f64a5d5f0bc86 (diff)
downloadgcc-eefe9a995ceec7fc5ca79505e96bda214e6bd82c.zip
gcc-eefe9a995ceec7fc5ca79505e96bda214e6bd82c.tar.gz
gcc-eefe9a995ceec7fc5ca79505e96bda214e6bd82c.tar.bz2
Makeifle-in (ipa-devirt.o): New.
* Makeifle-in (ipa-devirt.o): New. (GTFILES): Add ipa-utils.h and ipa-devirt.c * cgraphunit.c (decide_is_symbol_needed): Do not care about virtuals. (analyze_functions): Look into possible targets of polymorphic call. * dumpfile.c (dump_files): Add type-inheritance dump. * dumpfile.h (TDI_inheritance): New. * ipa-devirt.c: New file. * ipa-utils.h (odr_type_d): Forward declare. (odr_type): New type. (build_type_inheritance_graph): Declare. (possible_polymorphic_call_targets): Declare and introduce inline variant when only edge is pased. (dump_possible_polymorphic_call_targets): Likewise. * timevar.def (TV_IPA_INHERITANCE, TV_IPA_VIRTUAL_CALL): New. * tree.c (type_in_anonymous_namespace_p): Break out from ... (types_same_for_odr): ... here. * tree.h (type_in_anonymous_namespace_p): Declare. * g++.dg/ipa/type-inheritance-1.C: New testcase. From-SVN: r201836
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 9d4bc7f..1947105 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -11845,11 +11845,8 @@ types_same_for_odr (tree type1, tree type2)
/* Check for anonymous namespaces. Those have !TREE_PUBLIC
on the corresponding TYPE_STUB_DECL. */
- if (TYPE_STUB_DECL (type1) != TYPE_STUB_DECL (type2)
- && (!TYPE_STUB_DECL (type1)
- || !TYPE_STUB_DECL (type2)
- || !TREE_PUBLIC (TYPE_STUB_DECL (type1))
- || !TREE_PUBLIC (TYPE_STUB_DECL (type2))))
+ if (type_in_anonymous_namespace_p (type1)
+ || type_in_anonymous_namespace_p (type2))
return false;
if (!TYPE_NAME (type1))
@@ -11904,6 +11901,14 @@ obj_type_ref_class (tree ref)
return TREE_TYPE (ref);
}
+/* Return true if T is in anonymous namespace. */
+
+bool
+type_in_anonymous_namespace_p (tree t)
+{
+ return (TYPE_STUB_DECL (t) && !TREE_PUBLIC (TYPE_STUB_DECL (t)));
+}
+
/* Try to find a base info of BINFO that would have its field decl at offset
OFFSET within the BINFO type and which is of EXPECTED_TYPE. If it can be
found, return, otherwise return NULL_TREE. */