aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog27
-rw-r--r--gcc/cp/Make-lang.in14
-rw-r--r--gcc/cp/class.c6
-rw-r--r--gcc/cp/decl.c9
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/error.c18
-rw-r--r--gcc/cp/except.c22
-rw-r--r--gcc/cp/gxxint.texi6
-rw-r--r--gcc/cp/mangle.c22
-rw-r--r--gcc/cp/method.c16
-rw-r--r--gcc/cp/pt.c12
-rw-r--r--gcc/cp/tree.c2
12 files changed, 114 insertions, 42 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cc40d91..105f047 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,30 @@
+2000-12-04 Jason Merrill <jason@redhat.com>
+
+ * mangle.c (write_type): Mangle VECTOR_TYPE with "U8__vector".
+ (write_builtin_type): Pass intSI_type_node and the like through
+ type_for_mode.
+ * method.c (process_overload_item): Mangle VECTOR_TYPEs with 'o'.
+ Pass intSI_type_node and the like through type_for_mode.
+ * decl2.c (arg_assoc_type): Handle VECTOR_TYPE like COMPLEX_TYPE.
+ * pt.c (tsubst, unify): Likewise.
+ * tree.c (walk_tree): Likewise.
+ * error.c (dump_type): Likewise.
+ (dump_type_prefix, dump_type_suffix): Don't bother with VECTOR_TYPE.
+
+ * Make-lang.in: Tweak top comment for emacs.
+ (cp/TAGS): Restore.
+
+ * except.c (expand_throw): Use push_throw_library_fn for _Jv_Throw.
+
+ * pt.c (tsubst_decl): Call clone_function_decl here.
+ (do_decl_instantiation): Not here.
+ * class.c (clone_function_decl): Robustify.
+
+2000-12-04 Michael Matz <matzmich@cs.tu-berlin.de>
+
+ * decl.c (store_bindings): Only search in the non modified
+ old_bindings for duplicates.
+
2000-12-04 Nathan Sidwell <nathan@codesourcery.com>
* error.c (dump_function_decl): Use DECL_VIRTUAL_P, not
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 75e3b6c..0c1347a 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -1,4 +1,4 @@
-# Top level makefile fragment for GNU C++.
+# Top level -*- makefile -*- fragment for GNU C++.
# Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
@@ -273,3 +273,15 @@ cp/parse.o: cp/parse.c $(CXX_TREE_H) flags.h cp/lex.h except.h output.h \
system.h toplev.h $(GGC_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
$(srcdir)/cp/parse.c $(OUTPUT_OPTION)
+#
+# These exist for maintenance purposes.
+
+# Update the tags table.
+cp/TAGS: force
+ cd $(srcdir)/cp ; \
+ etags *.c *.h ; \
+ echo 'l' | tr 'l' '\f' >> TAGS ; \
+ echo 'parse.y,0' >> TAGS ; \
+ etags -a ../*.h ../*.c;
+
+.PHONY: cp/TAGS
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index b8d2a91..9a71203 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -4316,6 +4316,12 @@ clone_function_decl (fn, update_method_vec_p)
{
tree clone;
+ /* Avoid inappropriate cloning. */
+ if (! flag_new_abi
+ || (TREE_CHAIN (fn)
+ && DECL_CLONED_FUNCTION (TREE_CHAIN (fn))))
+ return;
+
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn))
{
/* For each constructor, we need two variants: an in-charge version
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 73684ac..b84e847 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2425,6 +2425,8 @@ store_bindings (names, old_bindings)
tree names, old_bindings;
{
tree t;
+ tree search_bindings = old_bindings;
+
for (t = names; t; t = TREE_CHAIN (t))
{
tree binding, t1, id;
@@ -2441,7 +2443,7 @@ store_bindings (names, old_bindings)
|| !(IDENTIFIER_BINDING (id) || IDENTIFIER_CLASS_VALUE (id)))
continue;
- for (t1 = old_bindings; t1; t1 = TREE_CHAIN (t1))
+ for (t1 = search_bindings; t1; t1 = TREE_CHAIN (t1))
if (TREE_VEC_ELT (t1, 0) == id)
goto skip_it;
@@ -11235,7 +11237,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
}
/* Until core issue 180 is resolved, allow 'friend typename A::B'.
- But don't allow implicit typenames. */
+ But don't allow implicit typenames except with a class-key. */
if (!current_aggr && (TREE_CODE (type) != TYPENAME_TYPE
|| IMPLICIT_TYPENAME_P (type)))
{
@@ -13570,7 +13572,8 @@ start_function (declspecs, declarator, attrs, flags)
/* Initialize RTL machinery. We cannot do this until
CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this
even when processing a template; this is how we get
- CFUN set up, and our per-function variables initialized. */
+ CFUN set up, and our per-function variables initialized.
+ FIXME factor out the non-RTL stuff. */
bl = current_binding_level;
init_function_start (decl1, input_filename, lineno);
current_binding_level = bl;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 497db61..99e5591 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4878,6 +4878,7 @@ arg_assoc_type (k, type)
case INTEGER_TYPE:
case REAL_TYPE:
case COMPLEX_TYPE:
+ case VECTOR_TYPE:
case CHAR_TYPE:
case BOOLEAN_TYPE:
return 0;
@@ -4888,7 +4889,6 @@ arg_assoc_type (k, type)
case POINTER_TYPE:
case REFERENCE_TYPE:
case ARRAY_TYPE:
- case VECTOR_TYPE:
return arg_assoc_type (k, TREE_TYPE (type));
case UNION_TYPE:
case ENUMERAL_TYPE:
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a77edf5..45863e1 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -447,6 +447,11 @@ dump_type (t, flags)
dump_type (TREE_TYPE (t), flags);
break;
+ case VECTOR_TYPE:
+ OB_PUTS ("vector ");
+ dump_type (TREE_TYPE (t), flags);
+ break;
+
case INTEGER_TYPE:
if (!TREE_UNSIGNED (TYPE_MAIN_VARIANT (t)) && TREE_UNSIGNED (t))
output_add_string (scratch_buffer, "unsigned ");
@@ -503,7 +508,6 @@ dump_type (t, flags)
reduces code size. */
case ARRAY_TYPE:
case POINTER_TYPE:
- case VECTOR_TYPE:
case REFERENCE_TYPE:
case OFFSET_TYPE:
offset_type:
@@ -662,15 +666,6 @@ dump_type_prefix (t, flags)
switch (TREE_CODE (t))
{
- case VECTOR_TYPE:
- padding = dump_type_prefix (TREE_TYPE (t), flags);
- if (padding != none)
- output_add_space (scratch_buffer);
- output_add_string (scratch_buffer, "vector");
- dump_qualifiers (t, before);
- padding = before;
- break;
-
case POINTER_TYPE:
case REFERENCE_TYPE:
{
@@ -748,6 +743,7 @@ dump_type_prefix (t, flags)
case VOID_TYPE:
case TYPENAME_TYPE:
case COMPLEX_TYPE:
+ case VECTOR_TYPE:
dump_type (t, flags);
padding = before;
break;
@@ -778,7 +774,6 @@ dump_type_suffix (t, flags)
case POINTER_TYPE:
case REFERENCE_TYPE:
case OFFSET_TYPE:
- case VECTOR_TYPE:
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
print_right_paren (scratch_buffer);
dump_type_suffix (TREE_TYPE (t), flags);
@@ -844,6 +839,7 @@ dump_type_suffix (t, flags)
case VOID_TYPE:
case TYPENAME_TYPE:
case COMPLEX_TYPE:
+ case VECTOR_TYPE:
break;
default:
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index d3c3d16..1c0d06a 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -692,8 +692,9 @@ expand_end_eh_spec (raises, try_block)
{
tmp = build_function_type (void_type_node, void_list_node);
fn = push_throw_library_fn (fn, tmp);
- /* Since the spec doesn't allow any exceptions, this call
- will never throw. */
+ /* Since the spec doesn't allow any exceptions, this call will
+ never throw. We use push_throw_library_fn because we do want
+ TREE_THIS_VOLATILE to be set. */
TREE_NOTHROW (fn) = 1;
}
tmp = NULL_TREE;
@@ -837,9 +838,7 @@ expand_throw (exp)
exception.cc. */
tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
tmp = build_function_type (ptr_type_node, tmp);
- fn = push_library_fn (fn, tmp);
- TREE_THIS_VOLATILE (fn) = 1;
- TREE_NOTHROW (fn) = 0;
+ fn = push_throw_library_fn (fn, tmp);
}
exp = build_function_call (fn, args);
@@ -886,17 +885,18 @@ expand_throw (exp)
user function that exits via an uncaught exception.
So we have to protect the actual initialization of the
- exception object with terminate(), but evaluate the expression
- first. We also expand the call to __eh_alloc
- first. Since there could be temps in the expression, we need
- to handle that, too. */
+ exception object with terminate(), but evaluate the
+ expression first. Since there could be temps in the
+ expression, we need to handle that, too. We also expand
+ the call to __eh_alloc first (which doesn't matter, since
+ it can't throw). */
my_friendly_assert (stmts_are_full_exprs_p () == 1, 19990926);
/* Store the throw expression into a temp. This can be less
efficient than storing it into the allocated space directly, but
- oh well. To do this efficiently we would need to insinuate
- ourselves into expand_call. */
+ if we allocated the space first we would have to deal with
+ cleaning it up if evaluating this expression throws. */
if (TREE_SIDE_EFFECTS (exp))
{
tree temp = create_temporary_var (TREE_TYPE (exp));
diff --git a/gcc/cp/gxxint.texi b/gcc/cp/gxxint.texi
index 69d187b..17bb81d 100644
--- a/gcc/cp/gxxint.texi
+++ b/gcc/cp/gxxint.texi
@@ -1769,6 +1769,12 @@ followed by the type index of the repeated type. Due to a bug in
g++ 2.7.2, this is only generated if index is 0. Superceded by
@samp{n} when squangling.
+@item O
+Pointer-to-member type.
+
+@item o
+vector type.
+
@item P
Indicates a pointer type. Followed by the type pointed to.
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 33eeefc..001a9e8 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1236,10 +1236,9 @@ write_local_name (function, local_entity, entity)
::= <CV-qualifier>
::= P <type> # pointer-to
::= R <type> # reference-to
- ::= C <type> # complex pair (C 2000) [not supported]
+ ::= C <type> # complex pair (C 2000)
::= G <type> # imaginary (C 2000) [not supported]
::= U <source-name> <type> # vendor extended type qualifier
- [not supported]
TYPE is a type node. */
@@ -1349,6 +1348,11 @@ write_type (type)
write_pointer_to_member_type (build_pointer_type (type));
break;
+ case VECTOR_TYPE:
+ write_string ("U8__vector");
+ write_type (TREE_TYPE (type));
+ break;
+
default:
my_friendly_abort (20000409);
}
@@ -1416,7 +1420,8 @@ write_CV_qualifiers_for_type (type)
::= f # float
::= d # double
::= e # long double, __float80
- ::= g # __float128 [not supported] */
+ ::= g # __float128 [not supported]
+ ::= u <source-name> # vendor extended type */
static void
write_builtin_type (type)
@@ -1446,6 +1451,7 @@ write_builtin_type (type)
size_t itk;
/* Assume TYPE is one of the shared integer type nodes. Find
it in the array of these nodes. */
+ iagain:
for (itk = 0; itk < itk_none; ++itk)
if (type == integer_types[itk])
{
@@ -1455,8 +1461,14 @@ write_builtin_type (type)
}
if (itk == itk_none)
- /* Couldn't find this type. */
- my_friendly_abort (20000408);
+ {
+ tree t = type_for_mode (TYPE_MODE (type), TREE_UNSIGNED (type));
+ if (type == t)
+ /* Couldn't find this type. */
+ my_friendly_abort (20000408);
+ type = t;
+ goto iagain;
+ }
}
break;
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 4f2e58d..4c59822 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1313,6 +1313,8 @@ process_overload_item (parmtype, extra_Gcode)
tree parmtype;
int extra_Gcode;
{
+ tree tmp;
+
numeric_output_need_bar = 0;
/* Our caller should have already handed any qualifiers, so pull out the
@@ -1421,6 +1423,7 @@ process_overload_item (parmtype, extra_Gcode)
}
case INTEGER_TYPE:
+ iagain:
if (parmtype == integer_type_node
|| parmtype == unsigned_type_node
|| parmtype == java_int_type_node)
@@ -1450,6 +1453,14 @@ process_overload_item (parmtype, extra_Gcode)
OB_PUTC ('x');
else if (parmtype == java_boolean_type_node)
OB_PUTC ('b');
+ /* Handle intSI_type_node and such like their C++ equivalents. */
+ else if (tmp = type_for_mode (TYPE_MODE (parmtype),
+ TREE_UNSIGNED (parmtype)),
+ parmtype != tmp)
+ {
+ parmtype = tmp;
+ goto iagain;
+ }
#if HOST_BITS_PER_WIDE_INT >= 64
else
{
@@ -1483,6 +1494,11 @@ process_overload_item (parmtype, extra_Gcode)
build_mangled_name_for_type (TREE_TYPE (parmtype));
break;
+ case VECTOR_TYPE:
+ OB_PUTC ('o');
+ build_mangled_name_for_type (TREE_TYPE (parmtype));
+ break;
+
case VOID_TYPE:
OB_PUTC ('v');
break;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index be82bd5..8d7f33b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5786,6 +5786,7 @@ tsubst_decl (t, args, type, in_decl)
maybe_retrofit_in_chrg (r);
if (DECL_CONSTRUCTOR_P (r))
grok_ctor_properties (ctx, r);
+ clone_function_decl(r, /*update_method_vec_p=*/0);
}
else if (IDENTIFIER_OPNAME_P (DECL_NAME (r)))
grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r));
@@ -6164,6 +6165,7 @@ tsubst (t, args, complain, in_decl)
case VOID_TYPE:
case REAL_TYPE:
case COMPLEX_TYPE:
+ case VECTOR_TYPE:
case BOOLEAN_TYPE:
case INTEGER_CST:
case REAL_CST:
@@ -8532,6 +8534,7 @@ unify (tparms, targs, parm, arg, strict)
case REAL_TYPE:
case COMPLEX_TYPE:
+ case VECTOR_TYPE:
case INTEGER_TYPE:
case BOOLEAN_TYPE:
case VOID_TYPE:
@@ -9222,15 +9225,6 @@ do_decl_instantiation (declspecs, declarator, storage)
cp_error ("storage class `%D' applied to template instantiation",
storage);
- /* Under the new ABI, we need to make sure to instantiate all the
- cloned versions of constructors or destructors. */
- if (flag_new_abi &&
- (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (result) ||
- DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (result)) &&
- !(TREE_CHAIN (result) &&
- DECL_CLONED_FUNCTION (TREE_CHAIN (result))))
- clone_function_decl(result, /*update_method_vec_p=*/0);
-
SET_DECL_EXPLICIT_INSTANTIATION (result);
mark_decl_instantiated (result, extern_p);
repo_template_instantiated (result, extern_p);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 517a5cc..653930e 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1319,6 +1319,7 @@ walk_tree (tp, func, data, htab)
case TEMPLATE_TYPE_PARM:
case REAL_TYPE:
case COMPLEX_TYPE:
+ case VECTOR_TYPE:
case VOID_TYPE:
case BOOLEAN_TYPE:
case TYPENAME_TYPE:
@@ -1336,7 +1337,6 @@ walk_tree (tp, func, data, htab)
case POINTER_TYPE:
case REFERENCE_TYPE:
- case VECTOR_TYPE:
WALK_SUBTREE (TREE_TYPE (*tp));
break;