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
+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.
+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.
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));
set_identifier_size (sizeof (struct lang_identifier));
decl_printable_name = lang_printable_name;
+ init_cplus_unsave ();
init_cplus_expand ();
bcopy (cplus_tree_code_type,
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;
+}
+
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));
\f
/* Init the principal obstacks. */
}
/* 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)
break;
default:
+ if (lang_unsave_expr_now)
+ (*lang_unsave_expr_now) (expr);
break;
}
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.