diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-23 00:26:04 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-23 00:26:04 +0000 |
commit | 215e2f1d86a587308fdbde512bb2f228ba224ae9 (patch) | |
tree | 0be6b0f8e11f86590d8a53628df5d2776497a29c /gcc/tree-gimple.c | |
parent | f09f2d78d2d06c18635dec7e3cc6c103fd174eee (diff) | |
download | gcc-215e2f1d86a587308fdbde512bb2f228ba224ae9.tar.gz |
* tree.def (VTABLE_REF): Remove.
(OBJ_TYPE_REF): New.
(TRY_CATCH_EXPR, TRY_FINALLY_EXPR): Set type 's'.
* expr.c (expand_expr_real_1): Replace VTABLE_REF with OBJ_TYPE_REF.
* fold-const.c (non_lvalue): Likewise.
* gimplify.c (gimplify_expr): Likewise.
(gimplify_call_expr): Use is_gimple_call_addr.
* langhooks-def.h (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
* langhooks.h (fold_obj_type_ref): New.
* tree-gimple.c (is_gimple_call_addr): New.
* tree-gimple.h (is_gimple_call_addr): Declare.
* tree-inline.c (inlinable_function_p): Fix merge error.
(estimate_num_insns_1): Replace VTABLE_REF with OBJ_TYPE_REF.
* tree-pretty-print.c (dump_generic_node): Likewise.
(print_call_name): Handle OBJ_TYPE_REF.
* tree-ssa-ccp.c (fold_stmt): Fold OBJ_TYPE_REF.
* tree-ssa-operands.c (get_expr_operands): Handle OBJ_TYPE_REF.
* tree.h (OBJ_TYPE_REF_EXPR): New.
(OBJ_TYPE_REF_OBJECT, OBJ_TYPE_REF_TOKEN): New.
* doc/c-tree.texi (VTABLE_REF): Remove.
* objc/objc-act.c (build_objc_method_call): Build an OBJ_TYPE_REF.
cp/
* class.c (build_vfn_ref): Take a pointer not object. Build
an OBJ_TYPE_REF.
(cp_fold_obj_type_ref): New.
* call.c (build_over_call): Update build_vfn_ref call.
* cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
* cp-tree.h (cp_fold_obj_type_ref): Declare.
testsuite/
* g++.dg/opt/devirt1.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83531 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r-- | gcc/tree-gimple.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c index 7c992b36adc..2deee183964 100644 --- a/gcc/tree-gimple.c +++ b/gcc/tree-gimple.c @@ -111,7 +111,7 @@ Boston, MA 02111-1307, USA. */ op0 -> lhs op1 -> rhs call-stmt: CALL_EXPR - op0 -> ID | '&' ID + op0 -> ID | '&' ID | OBJ_TYPE_REF op1 -> arglist addr-expr-arg : compref | ID @@ -158,6 +158,7 @@ Boston, MA 02111-1307, USA. */ | unop val | val binop val | '(' cast ')' val + | method_ref (cast here stands for all valid C typecasts) @@ -240,6 +241,7 @@ is_gimple_rhs (tree t) case STRING_CST: case COMPLEX_CST: case VECTOR_CST: + case OBJ_TYPE_REF: return 1; default: @@ -493,6 +495,14 @@ is_gimple_cast (tree t) || TREE_CODE (t) == FIX_ROUND_EXPR); } +/* Return true if T is a valid op0 of a CALL_EXPR. */ + +bool +is_gimple_call_addr (tree t) +{ + return (TREE_CODE (t) == OBJ_TYPE_REF + || is_gimple_val (t)); +} /* If T makes a function call, return the corresponding CALL_EXPR operand. Otherwise, return NULL_TREE. */ |