summaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-24 06:13:44 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-24 06:13:44 +0000
commit1fda15e2319ade173bbcfcee7a5272bc410ef17d (patch)
treebe52c0776019c9e0eed372c7670a1d87ad3d6732 /gcc/ipa-devirt.c
parent6ffeceb15bc17d43de07000e1806690a9b6c3c68 (diff)
downloadgcc-1fda15e2319ade173bbcfcee7a5272bc410ef17d.tar.gz
* ipa-utils.h (method_class_type): Remove.
* cgraphunit.c (walk_polymorphic_call_targets): Use TYPE_METHOD_BASETYPE. * ipa-devirt.c (type_in_anonymous_namespace_p): Check that it is called on main variants only. (method_class_type): Remove. (update_type_inheritance_graph): Use TYPE_METHOD_BASETYPE. (build_type_inheritance_graph): Likewise. * ipa-icf.c (sem_function::equals_wpa): Likewise. * pa-polymorphic-call.c (decl_maybe_in_construction_p, check_stmt_for_type_change): Use TYPE_METHOD_BASETYPE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223629 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r--gcc/ipa-devirt.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 09c3b5b0455..77ecd0d2d83 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -2279,18 +2279,6 @@ dump_type_inheritance_graph (FILE *f)
}
}
-/* Given method type T, return type of class it belongs to.
- Look up this pointer and get its type. */
-
-tree
-method_class_type (const_tree t)
-{
- tree first_parm_type = TREE_VALUE (TYPE_ARG_TYPES (t));
- gcc_assert (TREE_CODE (t) == METHOD_TYPE);
-
- return TREE_TYPE (first_parm_type);
-}
-
/* Initialize IPA devirt and build inheritance tree graph. */
void
@@ -2314,8 +2302,7 @@ build_type_inheritance_graph (void)
if (is_a <cgraph_node *> (n)
&& DECL_VIRTUAL_P (n->decl)
&& n->real_symbol_p ())
- get_odr_type (TYPE_MAIN_VARIANT (method_class_type (TREE_TYPE (n->decl))),
- true);
+ get_odr_type (TYPE_METHOD_BASETYPE (TREE_TYPE (n->decl)), true);
/* Look also for virtual tables of types that do not define any methods.
@@ -3446,8 +3433,7 @@ update_type_inheritance_graph (void)
if (DECL_VIRTUAL_P (n->decl)
&& !n->definition
&& n->real_symbol_p ())
- get_odr_type (method_class_type (TYPE_MAIN_VARIANT (TREE_TYPE (n->decl))),
- true);
+ get_odr_type (TYPE_METHOD_BASETYPE (TREE_TYPE (n->decl)), true);
timevar_pop (TV_IPA_INHERITANCE);
}