aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1998-06-03 21:33:03 -0400
committerJason Merrill <jason@gcc.gnu.org>1998-06-03 21:33:03 -0400
commit285baa062b5e9e5757e1dee8856af6b210918789 (patch)
tree7c6eb92cb6464b354079d1ffafd37d7cad944feb /gcc
parent6035f0aed86df4e731b88a96b1eee8e45644e3c4 (diff)
downloadgcc-285baa062b5e9e5757e1dee8856af6b210918789.zip
gcc-285baa062b5e9e5757e1dee8856af6b210918789.tar.gz
gcc-285baa062b5e9e5757e1dee8856af6b210918789.tar.bz2
error.c (dump_expr): Clean up NEW_EXPR case.
* error.c (dump_expr): Clean up NEW_EXPR case. * tree.c (mapcar): Support NEW_EXPR. * error.c (dump_expr): Support NEW_EXPR. * decl2.c (arg_assoc_type): Return 0 for LANG_TYPE. From-SVN: r20218
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog14
-rw-r--r--gcc/cp/decl2.c1
-rw-r--r--gcc/cp/error.c27
-rw-r--r--gcc/cp/tree.c7
4 files changed, 49 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6f115d6..d14af59 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,17 @@
+1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
+
+ * error.c (dump_expr): Clean up NEW_EXPR case.
+
+1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * tree.c (mapcar): Support NEW_EXPR.
+
+ * error.c (dump_expr): Support NEW_EXPR.
+
+1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (arg_assoc_type): Return 0 for LANG_TYPE.
+
1998-06-03 Jason Merrill <jason@yorick.cygnus.com>
* method.c (make_thunk): Use overload machinery to make name.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 77aaa2b..dc800da 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4208,6 +4208,7 @@ arg_assoc_type (k, type)
case COMPLEX_TYPE:
case CHAR_TYPE:
case BOOLEAN_TYPE:
+ case LANG_TYPE:
return 0;
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_P (type))
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 9202b39..7519461 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1341,6 +1341,33 @@ dump_expr (t, nop)
}
break;
+ case NEW_EXPR:
+ {
+ tree type = TREE_OPERAND (t, 1);
+ if (NEW_EXPR_USE_GLOBAL (t))
+ OB_PUTS ("::");
+ OB_PUTS ("new ");
+ if (TREE_OPERAND (t, 0))
+ {
+ OB_PUTC ('(');
+ dump_expr_list (TREE_OPERAND (t, 0));
+ OB_PUTS (") ");
+ }
+ if (TREE_CODE (type) == ARRAY_REF)
+ type = build_cplus_array_type
+ (TREE_OPERAND (type, 0),
+ build_index_type (size_binop (MINUS_EXPR, TREE_OPERAND (type, 1),
+ integer_one_node)));
+ dump_type (type, 0);
+ if (TREE_OPERAND (t, 2))
+ {
+ OB_PUTC ('(');
+ dump_expr_list (TREE_OPERAND (t, 2));
+ OB_PUTC (')');
+ }
+ }
+ break;
+
case TARGET_EXPR:
/* Note that this only works for G++ target exprs. If somebody
builds a general TARGET_EXPR, there's no way to represent that
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index de15c07..685645a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1754,6 +1754,13 @@ mapcar (t, func)
TREE_OPERAND (t, 2) = NULL_TREE;
return t;
+ case NEW_EXPR:
+ t = copy_node (t);
+ TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
+ TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
+ TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
+ return t;
+
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_P (t))
return build_ptrmemfunc_type