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.def | |
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.def')
-rw-r--r-- | gcc/tree.def | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/tree.def b/gcc/tree.def index 12a6394c5b1..57596a2b458 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -387,12 +387,17 @@ DEFTREECODE (ARRAY_REF, "array_ref", 'r', 4) of the range is taken from the type of the expression. */ DEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", 'r', 4) -/* Vtable indexing. Carries data useful for emitting information - for vtable garbage collection. - Operand 0: an array_ref (or equivalent expression) - Operand 1: the vtable base (must be a var_decl) - Operand 2: index into vtable (must be an integer_cst). */ -DEFTREECODE (VTABLE_REF, "vtable_ref", 'r', 3) +/* Used to represent lookup of runtime type dependent data. Often this is + a reference to a vtable, but it needn't be. Operands are: + OBJ_TYPE_REF_EXPR: An expression that evaluates the value to use. + OBJ_TYPE_REF_OBJECT: Is the object on whose behalf the lookup is + being performed. Through this the optimizers may be able to statically + determine the dynamic type of the object. + OBJ_TYPE_REF_TOKEN: Something front-end specific used to resolve the + reference to something simpler, usually to the address of a DECL. + Never touched by the middle-end. Good choices would be either an + identifier or a vtable index. */ +DEFTREECODE (OBJ_TYPE_REF, "obj_type_ref", 'e', 3) /* The exception object from the runtime. */ DEFTREECODE (EXC_PTR_EXPR, "exc_ptr_expr", 'e', 0) @@ -790,12 +795,12 @@ DEFTREECODE (VA_ARG_EXPR, "va_arg_expr", 'e', 1) This differs from TRY_FINALLY_EXPR in that operand 2 is not evaluated on a normal or jump exit, only on an exception. */ -DEFTREECODE (TRY_CATCH_EXPR, "try_catch_expr", 'e', 2) +DEFTREECODE (TRY_CATCH_EXPR, "try_catch_expr", 's', 2) /* Evaluate the first operand. The second operand is a cleanup expression which is evaluated on any exit (normal, exception, or jump out) from this expression. */ -DEFTREECODE (TRY_FINALLY_EXPR, "try_finally", 'e', 2) +DEFTREECODE (TRY_FINALLY_EXPR, "try_finally", 's', 2) /* These types of expressions have no useful value, and always have side effects. */ |