tree.c (lang_unsave_expr_now) : New.
	(unsave_expr_now): Call lang_unsave_expr_now.
	tree.h (lang_unsave_expr_now) : New.

For gcc/cp:
	cp-tree.h (init_cplus_unsave): New.
	(cplus_unsave_expr_now): New.
	lex.c (init_parse): Call init_cplus_unsave.
	tree.c (init_cplus_unsave): New.
	(cplus_unsave_expr_now): New.

From-SVN: r28705
This commit is contained in:
Gavin Romig-Koch 1999-08-13 18:22:59 +00:00 committed by Gavin Romig-Koch
parent e3beae8c3c
commit 0a818f84ce
7 changed files with 70 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Fri Aug 13 14:18:27 1999 Gavin Romig-Koch <gavin@cygnus.com>
tree.c (lang_unsave_expr_now) : New.
(unsave_expr_now): Call lang_unsave_expr_now.
tree.h (lang_unsave_expr_now) : New.
Fri Aug 13 00:49:46 1999 Jason Merrill <jason@yorick.cygnus.com>
* toplev.c (flag_new_exceptions): On by default.

View File

@ -1,3 +1,11 @@
1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
cp-tree.h (init_cplus_unsave): New.
(cplus_unsave_expr_now): New.
lex.c (init_parse): Call init_cplus_unsave.
tree.c (init_cplus_unsave): New.
(cplus_unsave_expr_now): New.
1999-08-11 Jason Merrill <jason@yorick.cygnus.com>
* lang-options.h: Add -fms-extensions.

View File

@ -3350,6 +3350,8 @@ extern int yylex PROTO((void));
extern tree arbitrate_lookup PROTO((tree, tree, tree));
/* in tree.c */
extern void init_cplus_unsave PROTO((void));
extern tree cplus_unsave_expr_now PROTO((tree));
extern int pod_type_p PROTO((tree));
extern void unshare_base_binfos PROTO((tree));
extern int member_p PROTO((tree));

View File

@ -524,6 +524,7 @@ init_parse (filename)
set_identifier_size (sizeof (struct lang_identifier));
decl_printable_name = lang_printable_name;
init_cplus_unsave ();
init_cplus_expand ();
bcopy (cplus_tree_code_type,

View File

@ -2859,3 +2859,41 @@ make_ptrmem_cst (type, member)
return ptrmem_cst;
}
/* Initialize unsave for C++. */
void
init_cplus_unsave ()
{
lang_unsave_expr_now = cplus_unsave_expr_now;
}
/* The C++ version of unsave_expr_now.
See gcc/tree.c:unsave_expr_now for comments. */
tree
cplus_unsave_expr_now (expr)
tree expr;
{
if (expr == NULL)
return expr;
else if (TREE_CODE (expr) == AGGR_INIT_EXPR)
{
unsave_expr_now (TREE_OPERAND (expr,0));
if (TREE_OPERAND (expr, 1)
&& TREE_CODE (TREE_OPERAND (expr, 1)) == TREE_LIST)
{
tree exp = TREE_OPERAND (expr, 1);
while (exp)
{
unsave_expr_now (TREE_VALUE (exp));
exp = TREE_CHAIN (exp);
}
}
unsave_expr_now (TREE_OPERAND (expr,2));
return expr;
}
else
return expr;
}

View File

@ -269,6 +269,10 @@ static void build_real_from_int_cst_1 PROTO((PTR));
extern char *mode_name[];
void gcc_obstack_init ();
/* If non-null, a language specific helper for unsave_expr_now. */
int (*lang_unsave_expr_now) PROTO((tree));
/* Init the principal obstacks. */
@ -2426,7 +2430,11 @@ first_rtl_op (code)
}
/* Modify a tree in place so that all the evaluate only once things
are cleared out. Return the EXPR given. */
are cleared out. Return the EXPR given.
LANG_UNSAVE_EXPR_NOW, if set, is a pointer to a function to handle
language specific nodes.
*/
tree
unsave_expr_now (expr)
@ -2473,6 +2481,8 @@ unsave_expr_now (expr)
break;
default:
if (lang_unsave_expr_now)
(*lang_unsave_expr_now) (expr);
break;
}

View File

@ -1714,6 +1714,10 @@ extern tree unsave_expr PROTO((tree));
extern tree unsave_expr_now PROTO((tree));
/* If non-null, a language specific helper for unsave_expr_now. */
extern int (*lang_unsave_expr_now) PROTO((tree));
/* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
or offset that depends on a field within a record.