Commit 018a5803 by Nathan Sidwell

cp-tree.def (NON_DEPENDENT_EXPR): Add operand.

	* cp-tree.def (NON_DEPENDENT_EXPR): Add operand.
	* decl2.c (build_offset_ref_call_from_tree): Use
	build_non_dependent_expr.
	* error.c (dump_expr) <NON_DEPENDENT_EXPR case>: Dump the operand.
	* pt.c (build_non_dependent_expr): Set operand.

From-SVN: r70478
parent 6cad4e17
2003-08-15 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.def (NON_DEPENDENT_EXPR): Add operand.
* decl2.c (build_offset_ref_call_from_tree): Use
build_non_dependent_expr.
* error.c (dump_expr) <NON_DEPENDENT_EXPR case>: Dump the operand.
* pt.c (build_non_dependent_expr): Set operand.
2003-08-14 Jan Hubicka <jh@suse.cz> 2003-08-14 Jan Hubicka <jh@suse.cz>
* decl2.c (mark_member_pointers): Rename to... * decl2.c (mark_member_pointers): Rename to...
...@@ -5,9 +13,9 @@ ...@@ -5,9 +13,9 @@
(lower_function): Update call. (lower_function): Update call.
* except.c (eh_type_info): Break out from ... * except.c (eh_type_info): Break out from ...
(build_eh_type): ... here; tinfo is already used. (build_eh_type): ... here; tinfo is already used.
(finish_eh_spec_block): Mark tinfos as used. (finish_eh_spec_block): Mark tinfos as used.
* semantics.c (finish_handler_params): Mark tinfo as used. * semantics.c (finish_handler_params): Mark tinfo as used.
* cp-tree.h(eh_type_info): Declare. * cp-tree.h (eh_type_info): Declare.
2003-08-15 Nathan Sidwell <nathan@codesourcery.com> 2003-08-15 Nathan Sidwell <nathan@codesourcery.com>
......
...@@ -240,8 +240,9 @@ DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3) ...@@ -240,8 +240,9 @@ DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3)
modify the original expression, which would change the mangling of modify the original expression, which would change the mangling of
that expression if it appeared in a template argument list. In that expression if it appeared in a template argument list. In
that situation, we create a NON_DEPENDENT_EXPR to take the place of that situation, we create a NON_DEPENDENT_EXPR to take the place of
the original expression. */ the original expression. The expression is the only operand -- it
DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", 'e', 0) is only needed for diagnostics. */
DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", 'e', 1)
/* CTOR_INITIALIZER is a placeholder in template code for a call to /* CTOR_INITIALIZER is a placeholder in template code for a call to
setup_vtbl_pointer (and appears in all functions, not just ctors). */ setup_vtbl_pointer (and appears in all functions, not just ctors). */
......
...@@ -2981,27 +2981,25 @@ finish_file () ...@@ -2981,27 +2981,25 @@ finish_file ()
input_location = locus; input_location = locus;
} }
/* FN is an OFFSET_REF indicating the function to call in parse-tree /* FN is an OFFSET_REF, DOTSTAR_EXPR or MEMBER_REF indicating the
form; it has not yet been semantically analyzed. ARGS are the function to call in parse-tree form; it has not yet been
arguments to the function. They have already been semantically semantically analyzed. ARGS are the arguments to the function.
analzyed. */ They have already been semantically analyzed. */
tree tree
build_offset_ref_call_from_tree (tree fn, tree args) build_offset_ref_call_from_tree (tree fn, tree args)
{ {
tree object_addr;
tree orig_fn; tree orig_fn;
tree orig_args; tree orig_args;
tree expr; tree expr;
tree object;
orig_fn = fn; orig_fn = fn;
orig_args = args; orig_args = args;
object = TREE_OPERAND (fn, 0);
if (processing_template_decl) if (processing_template_decl)
{ {
tree object;
tree object_type;
my_friendly_assert (TREE_CODE (fn) == DOTSTAR_EXPR my_friendly_assert (TREE_CODE (fn) == DOTSTAR_EXPR
|| TREE_CODE (fn) == MEMBER_REF, || TREE_CODE (fn) == MEMBER_REF,
20030708); 20030708);
...@@ -3013,10 +3011,9 @@ build_offset_ref_call_from_tree (tree fn, tree args) ...@@ -3013,10 +3011,9 @@ build_offset_ref_call_from_tree (tree fn, tree args)
parameter. That must be done before the FN is transformed parameter. That must be done before the FN is transformed
because we depend on the form of FN. */ because we depend on the form of FN. */
args = build_non_dependent_args (args); args = build_non_dependent_args (args);
object_type = TREE_TYPE (TREE_OPERAND (fn, 0));
if (TREE_CODE (fn) == DOTSTAR_EXPR) if (TREE_CODE (fn) == DOTSTAR_EXPR)
object_type = build_pointer_type (non_reference (object_type)); object = build_unary_op (ADDR_EXPR, object, 0);
object = build (NON_DEPENDENT_EXPR, object_type); object = build_non_dependent_expr (object);
args = tree_cons (NULL_TREE, object, args); args = tree_cons (NULL_TREE, object, args);
/* Now that the arguments are done, transform FN. */ /* Now that the arguments are done, transform FN. */
fn = build_non_dependent_expr (fn); fn = build_non_dependent_expr (fn);
...@@ -3030,7 +3027,7 @@ build_offset_ref_call_from_tree (tree fn, tree args) ...@@ -3030,7 +3027,7 @@ build_offset_ref_call_from_tree (tree fn, tree args)
void B::g() { (this->*p)(); } */ void B::g() { (this->*p)(); } */
if (TREE_CODE (fn) == OFFSET_REF) if (TREE_CODE (fn) == OFFSET_REF)
{ {
object_addr = build_unary_op (ADDR_EXPR, TREE_OPERAND (fn, 0), 0); tree object_addr = build_unary_op (ADDR_EXPR, object, 0);
fn = TREE_OPERAND (fn, 1); fn = TREE_OPERAND (fn, 1);
fn = get_member_function_from_ptrfunc (&object_addr, fn); fn = get_member_function_from_ptrfunc (&object_addr, fn);
args = tree_cons (NULL_TREE, object_addr, args); args = tree_cons (NULL_TREE, object_addr, args);
......
...@@ -1876,9 +1876,7 @@ dump_expr (tree t, int flags) ...@@ -1876,9 +1876,7 @@ dump_expr (tree t, int flags)
break; break;
case NON_DEPENDENT_EXPR: case NON_DEPENDENT_EXPR:
pp_string (cxx_pp, "<expression of type "); dump_expr (TREE_OPERAND (t, 0), flags);
dump_type (TREE_TYPE (t), flags);
pp_greater (cxx_pp);
break; break;
/* This list is incomplete, but should suffice for now. /* This list is incomplete, but should suffice for now.
......
...@@ -11793,7 +11793,7 @@ build_non_dependent_expr (tree expr) ...@@ -11793,7 +11793,7 @@ build_non_dependent_expr (tree expr)
the expression so that mangling (say) "f<g>" inside the body of the expression so that mangling (say) "f<g>" inside the body of
"f" works out correctly. Therefore, the REFERENCE_TYPE is "f" works out correctly. Therefore, the REFERENCE_TYPE is
stripped here. */ stripped here. */
return build (NON_DEPENDENT_EXPR, non_reference (TREE_TYPE (expr))); return build1 (NON_DEPENDENT_EXPR, non_reference (TREE_TYPE (expr)), expr);
} }
/* ARGS is a TREE_LIST of expressions as arguments to a function call. /* ARGS is a TREE_LIST of expressions as arguments to a function call.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment