aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-06-09 12:26:24 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-06-09 12:26:24 -0400
commit669ec2b4f0d25a10753a0c98ff786c4cb0e152a5 (patch)
treefdc9f3bc814a3a9dc10638c0528a97fecd63ad7b /gcc/cp/mangle.c
parentea11ca7ec12df7f53d437a738f984e26ef7ab85b (diff)
downloadgcc-669ec2b4f0d25a10753a0c98ff786c4cb0e152a5.zip
gcc-669ec2b4f0d25a10753a0c98ff786c4cb0e152a5.tar.gz
gcc-669ec2b4f0d25a10753a0c98ff786c4cb0e152a5.tar.bz2
revert mangling patch
From-SVN: r34471
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c56
1 files changed, 16 insertions, 40 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index ed46929..2bba09f 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -998,10 +998,8 @@ write_special_name_constructor (ctor)
write_string ("C1");
else if (DECL_BASE_CONSTRUCTOR_P (ctor))
write_string ("C2");
- else if (flag_new_abi)
- write_string ("C*INTERNAL*");
else
- write_string ("C1");
+ write_string ("C*INTERNAL*");
}
/* Handle destructor productions of non-terminal <special-name>.
@@ -1025,10 +1023,9 @@ write_special_name_destructor (dtor)
write_string ("D1");
else if (DECL_BASE_DESTRUCTOR_P (dtor))
write_string ("D2");
- else if (flag_new_abi)
- write_string ("D*INTERNAL*");
else
- write_string ("D0");
+ /* Old-ABI destructor. */
+ write_string ("D*INTERNAL*");
}
/* Return the discriminator for ENTITY appearing inside
@@ -1567,17 +1564,8 @@ write_expression (expr)
if (TREE_CODE (expr) == ADDR_EXPR
&& TREE_TYPE (expr)
&& TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE)
- {
- expr = TREE_OPERAND (expr, 0);
- if (DECL_P (expr))
- {
- write_expression (expr);
- return;
- }
+ expr = TREE_OPERAND (expr, 0);
- code = TREE_CODE (expr);
- }
-
/* If it wasn't any of those, recursively expand the expression. */
write_string (operator_name_info[(int) code].mangled_name);
@@ -1981,27 +1969,6 @@ mangle_typeinfo_for_type (type)
return mangle_special_for_type (type, "TI");
}
-/* Return the mangled name of the function that returns the typeinfo
- for TYPE. */
-
-tree
-mangle_typeinfo_fn_for_type (type)
- tree type;
-{
- my_friendly_assert (!new_abi_rtti_p (), 20000608);
- return mangle_special_for_type (type, "TF");
-}
-
-/* Return the name of the variable that represents TYPE at runtime in
- Java. */
-
-tree
-mangle_java_reflection_var_for_type (type)
- tree type;
-{
- return mangle_special_for_type (type, "TJ");
-}
-
/* Create an identifier for the mangled name of the NTBS containing
the mangled name of TYPE. */
@@ -2118,7 +2085,15 @@ mangle_thunk (fn_decl, offset, vcall_offset)
/* Return an identifier for the mangled unqualified name for a
conversion operator to TYPE. This mangling is not specified by the
- ABI spec; it is only used internally. */
+ ABI spec; it is only used internally.
+
+ For compatibility with existing conversion operator mechanisms,
+ the mangled form is `__op<type>' where <type> is the mangled
+ representation of TYPE.
+
+ FIXME: Though identifiers with starting with __op are reserved for
+ the implementation, it would eventually be nice to use inaccessible
+ names for these operators. */
tree
mangle_conv_op_name_for_type (type)
@@ -2129,10 +2104,11 @@ mangle_conv_op_name_for_type (type)
/* Build the mangling for TYPE. */
const char *mangled_type = mangle_type_string (type);
/* Allocate a temporary buffer for the complete name. */
- char *op_name = (char *) xmalloc (strlen ("operator ")
+ char *op_name = (char *) xmalloc (strlen (OPERATOR_TYPENAME_FORMAT)
+ strlen (mangled_type) + 1);
/* Assemble the mangling. */
- sprintf (op_name, "operator %s", mangled_type);
+ strcpy (op_name, OPERATOR_TYPENAME_FORMAT);
+ strcat (op_name, mangled_type);
/* Find or create an identifier. */
identifier = get_identifier (op_name);
/* Done with the temporary buffer. */