diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1997-10-14 18:43:16 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1997-10-14 14:43:16 -0400 |
commit | f06327624c2ba261ae82d633a29fa8fa98506bef (patch) | |
tree | 8445edfe678903489aa1773aae6020e788c4e53f /gcc | |
parent | 378ec56d93c6223b6b2466bd564f1fc53b311ce9 (diff) | |
download | gcc-f06327624c2ba261ae82d633a29fa8fa98506bef.zip gcc-f06327624c2ba261ae82d633a29fa8fa98506bef.tar.gz gcc-f06327624c2ba261ae82d633a29fa8fa98506bef.tar.bz2 |
* tree.c (expr_tree_cons, build_expr_list, expralloc): New fns.
From-SVN: r15898
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/tree.c | 38 |
2 files changed, 42 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4c5d7da..5b9bdbb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 14 11:30:29 1997 Jason Merrill <jason@yorick.cygnus.com> + + * tree.c (expr_tree_cons, build_expr_list, expralloc): New fns. + Fri Oct 10 13:46:56 1997 Doug Evans <dje@canuck.cygnus.com> * configure.in: Handle --with-newlib. @@ -704,6 +704,16 @@ savealloc (size) { return (char *) obstack_alloc (saveable_obstack, size); } + +/* Allocate SIZE bytes in the expression obstack + and return a pointer to them. */ + +char * +expralloc (size) + int size; +{ + return (char *) obstack_alloc (expression_obstack, size); +} /* Print out which obstack an object is in. */ @@ -2002,6 +2012,20 @@ build_decl_list (parm, value) return node; } +/* Similar, but build on the expression_obstack. */ + +tree +build_expr_list (parm, value) + tree parm, value; +{ + register tree node; + register struct obstack *ambient_obstack = current_obstack; + current_obstack = expression_obstack; + node = build_tree_list (parm, value); + current_obstack = ambient_obstack; + return node; +} + /* Return a newly created TREE_LIST node whose purpose and value fields are PARM and VALUE and whose TREE_CHAIN is CHAIN. */ @@ -2048,6 +2072,20 @@ decl_tree_cons (purpose, value, chain) return node; } +/* Similar, but build on the expression_obstack. */ + +tree +expr_tree_cons (purpose, value, chain) + tree purpose, value, chain; +{ + register tree node; + register struct obstack *ambient_obstack = current_obstack; + current_obstack = expression_obstack; + node = tree_cons (purpose, value, chain); + current_obstack = ambient_obstack; + return node; +} + /* Same as `tree_cons' but make a permanent object. */ tree |