aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1997-10-14 18:43:16 +0000
committerJason Merrill <jason@gcc.gnu.org>1997-10-14 14:43:16 -0400
commitf06327624c2ba261ae82d633a29fa8fa98506bef (patch)
tree8445edfe678903489aa1773aae6020e788c4e53f /gcc/tree.c
parent378ec56d93c6223b6b2466bd564f1fc53b311ce9 (diff)
downloadgcc-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/tree.c')
-rw-r--r--gcc/tree.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 9d6850f..6812aa4 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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