summaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-13 12:19:02 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-13 12:19:02 +0000
commite4227d049cda6d627df1765ee46f66a25bbcdd3a (patch)
tree738b62ee098203af9907f27ef12957227e55a707 /gcc/gimple.c
parentbb348f6843b09fce6b0b3b14104cd5542bb89b65 (diff)
downloadgcc-e4227d049cda6d627df1765ee46f66a25bbcdd3a.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159362 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 6f3ba6dfb3a..6f61ca7935a 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"