diff options
author | Martin Jambor <mjambor@suse.cz> | 2010-05-13 14:19:02 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2010-05-13 14:19:02 +0200 |
commit | 1ae6fe9be53077b9225cec4eea1f52e5e539b741 (patch) | |
tree | 738b62ee098203af9907f27ef12957227e55a707 /gcc/gimple.c | |
parent | 2b45bf2152099996118ac8903d22718963cf1e99 (diff) | |
download | gcc-1ae6fe9be53077b9225cec4eea1f52e5e539b741.zip gcc-1ae6fe9be53077b9225cec4eea1f52e5e539b741.tar.gz gcc-1ae6fe9be53077b9225cec4eea1f52e5e539b741.tar.bz2 |
gimple.c (gimple_fold_obj_type_ref): Removed (a replacement moved to gimple-fold.c).
2010-05-13 Martin Jambor <mjambor@suse.cz>
* gimple.c (gimple_fold_obj_type_ref): Removed (a replacement moved to
gimple-fold.c).
* gimple-fold.c (get_base_binfo_for_type): New function.
(gimple_get_relevant_ref_binfo): Likewise.
(gimple_fold_obj_type_ref_known_binfo): Likewise.
(gimple_fold_obj_type_ref): Likewise.
(fold_gimple_call): Simplify condition for folding virtual calls
and call gimple_fold_obj_type_ref.
* gimple.h (gimple_get_relevant_ref_binfo): Declare.
(gimple_fold_obj_type_ref_known_binfo): Likewise.
* testsuite/g++.dg/otr-fold-1.C: New test.
* testsuite/g++.dg/otr-fold-2.C: New test.
From-SVN: r159362
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 6f3ba6d..6f61ca7 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -4685,43 +4685,4 @@ gimple_decl_printable_name (tree decl, int verbosity) return IDENTIFIER_POINTER (DECL_NAME (decl)); } - -/* Fold a OBJ_TYPE_REF expression to the address of a function. - KNOWN_TYPE carries the true type of OBJ_TYPE_REF_OBJECT(REF). Adapted - from cp_fold_obj_type_ref, but it tolerates types with no binfo - data. */ - -tree -gimple_fold_obj_type_ref (tree ref, tree known_type) -{ - HOST_WIDE_INT index; - HOST_WIDE_INT i; - tree v; - tree fndecl; - - if (TYPE_BINFO (known_type) == NULL_TREE) - return NULL_TREE; - - v = BINFO_VIRTUALS (TYPE_BINFO (known_type)); - index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); - i = 0; - while (i != index) - { - i += (TARGET_VTABLE_USES_DESCRIPTORS - ? TARGET_VTABLE_USES_DESCRIPTORS : 1); - v = TREE_CHAIN (v); - } - - fndecl = TREE_VALUE (v); - -#ifdef ENABLE_CHECKING - gcc_assert (tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref), - DECL_VINDEX (fndecl))); -#endif - - cgraph_node (fndecl)->local.vtable_method = true; - - return build_fold_addr_expr (fndecl); -} - #include "gt-gimple.h" |