summaryrefslogtreecommitdiffstats
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-08 17:34:33 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-08 17:34:33 +0000
commitf2b8a47dda48aed89fbac66ebb8455cf206cae83 (patch)
tree05fb2eb51daae6893a4a0ff5e95026d9f771681c /gcc/cp/mangle.c
parent0a44b200168626349c722e2d2c2290b635d1533a (diff)
downloadppe42-gcc-f2b8a47dda48aed89fbac66ebb8455cf206cae83.tar.gz
ppe42-gcc-f2b8a47dda48aed89fbac66ebb8455cf206cae83.zip
* invoke.texi: Remove documentation for -fsquangle and
-fname-mangling-version. Remove old ABI mangling code. * cp-tree.h (cp_tree_index): Remove CPTI_TINFO_DECL_ID and CPTI_TINFO_VAR_ID. (tinfo_decl_id): Remove. (tinfo_var_id): Likewise. (name_mangling_version): Likewise. (flag_do_squangling): Likewise. (get_vtt_name): Likewise. (init_method): Likewise. (build_overload_name): Likewise. (build_static_name): Likewise. (build_decl_overload_real): Likewise. (build_overload_with_type): Likewise. (build_destructor_name): Likewise. (get_id_2): Likewise. (get_ctor_vtbl_name): Likewise. (mangle_typeinfo_fn_for_type): New function. (mangle_java_reflection_var_for_type): Likewise. * call.c (build_new_method_call): Use mangle_vtt_for_type. * class.c (get_vtable_name): Remove. (get_vtt_name): Remove. (get_vtable_decl): Use mangle_vtbl_for_type. (build_vtt): Likewise. (build_ctor_vtbl_group): Remove old ABI mangling support. * decl.c (pushtag): Likewise. (maybe_commonize_var): Use set_mangled_name_for_decl. (grokfndecl): Remove old ABI mangling support. (grokvardecl): Likewise. (grokdeclarator): Likewise. (grok_op_properties): Adjust use of DEF_OPERATOR. * decl2.c (name_mangling_version): Remove. (lang_f_options): Remove squangle. (unsupported_options): Add squangle. (lang_decode_options): Don't set flag_do_squangling. Issue a warning for -fname-mangling-version. (grokclassfn): Remove old ABI mangling support. (finish_static_data_member_decl): Likewise. (grokfield): Likewise. (grokoptypename): Likewise. (get_sentry): Likewise. * init.c (build_java_class_ref): Use mangle_java_reflection_var_for_type. * lex.c (init_operators): Adjust use of DEF_OPERATOR. (init_parse): Call init_mangle, not init_method. * mangle.c (write_special_name_constructor): Handle maybe-in-charge constructors. (write_special_name_destructor): Handle maybe-in-charge destructors. (write_expression): Tweak code to handle non-type template arguments with reference type. (mangle_typeinfo_fn_for_type): New function. (mangle_java_reflection_var_for_type): Likewise. (mangle_conv_op_name_for_type): Don't use a name that the user could type. * method.c (enum mangling_flags): Remove. (mangling_flags): Likewise. (obstack_chunk_alloc): Likewise. (obstack_chunk_free): Likewise. (OB_INIT): Likewise. (OB_PUTC): Likewise. (OB_PUTC2): Likewise. (OB_PUTS): Likewise. (OB_PUTID): Likewise. (OB_PUTCP): Likewise. (OB_FINISH): Likewise. (OB_LAST): Likewise. (btypelist): Likewise. (ktypelist): Likewise. (maxbtype): Likewise. (maxktype): Likewise. (typevec): Likewise. (maxtype): Likewise. (init_method): Likewise. (digit_buffer): Likewise. (nofold): Likewise. (start_squangling): Likewise. (end_squangling): Likewise. (icat): Likewise. (dicat): Likewise. (old_backref_index): Likewise. (flush_repeats): Likewise. (is_back_referenceable_type): Likewise. (issue_nrepeats): Likewise. (check_ktype): Likewise. (issue_ktype): Likewise. (build_overload_nested_name): Likewise. (build_underscore_int): Likewise. (build_overload_scope_ref): Likewise. (mangle_expression): Likewise. (build_overload_int): Likewise. (mangled_C9x_name): Likewise. (build_overload_value): Likewise. (build_template_template_parm_names): Likewise. (build_template_parm_names): Likewise. (build_overload_identifier): Likewise. (build_qualified_name): Likewise. (build_mangled_name_for_type_with_Gcode): Likewise. (build_mangled_name_for_type): Likewise. (build_overload_name): Likewise. (build_mangled_name): Likewise. (process_modifiers): Likewise. (check_btype): Likewise. (process_overload_item): Likewise. (build_static_name): Likewise. (build_decl_overload_real): Likewise. (set_mangled_name_for_decl): Remove old ABI mangling support. (build_typename_overload): Remove. (build_overload_with_type): Remove. (get_id_2): Remove. (get_ctor_vtbl_name): Remove. (build_destructor_name): Likewise. (set_mangled_name_for_decl): Likewise. (make_thunk): Remove old ABI mangling support. * operators.def: Likewise. * pt.c (check_explicit_specialization): Don't call set_mangled_name_for_template_decl. (lookup_template_class): Remove old ABI mangling support. (tsubst_friend_function): Update comment. (tsubst_decl): Remove old ABI mangling support. (tsubst_copy): Likewise. (set_mangled_name_for_template_decl): Remove. * rtti.c (init_rtti_processing): Use std_identifier. Don't set tinfo_decl_id or tinfo_var_id. (get_tinfo_var): Use mangle_typeinfo_for_type. (tinfo_name): Remove old ABI mangling support. (get_tinfo_decl): Likewise. (tinfo_base_init): Likewise. (create_real_tinfo_var): Use a name that the user can't type. * tinfo2.cc (BUILTIN): Adjust to use new mangling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34458 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c56
1 files changed, 40 insertions, 16 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 2bba09f518b..ed4692945a5 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -998,8 +998,10 @@ write_special_name_constructor (ctor)
write_string ("C1");
else if (DECL_BASE_CONSTRUCTOR_P (ctor))
write_string ("C2");
- else
+ else if (flag_new_abi)
write_string ("C*INTERNAL*");
+ else
+ write_string ("C1");
}
/* Handle destructor productions of non-terminal <special-name>.
@@ -1023,9 +1025,10 @@ write_special_name_destructor (dtor)
write_string ("D1");
else if (DECL_BASE_DESTRUCTOR_P (dtor))
write_string ("D2");
- else
- /* Old-ABI destructor. */
+ else if (flag_new_abi)
write_string ("D*INTERNAL*");
+ else
+ write_string ("D0");
}
/* Return the discriminator for ENTITY appearing inside
@@ -1564,8 +1567,17 @@ write_expression (expr)
if (TREE_CODE (expr) == ADDR_EXPR
&& TREE_TYPE (expr)
&& TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE)
- expr = TREE_OPERAND (expr, 0);
+ {
+ expr = TREE_OPERAND (expr, 0);
+ if (DECL_P (expr))
+ {
+ write_expression (expr);
+ return;
+ }
+ code = TREE_CODE (expr);
+ }
+
/* If it wasn't any of those, recursively expand the expression. */
write_string (operator_name_info[(int) code].mangled_name);
@@ -1969,6 +1981,27 @@ 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. */
@@ -2085,15 +2118,7 @@ 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.
-
- 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. */
+ ABI spec; it is only used internally. */
tree
mangle_conv_op_name_for_type (type)
@@ -2104,11 +2129,10 @@ 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_TYPENAME_FORMAT)
+ char *op_name = (char *) xmalloc (strlen ("operator ")
+ strlen (mangled_type) + 1);
/* Assemble the mangling. */
- strcpy (op_name, OPERATOR_TYPENAME_FORMAT);
- strcat (op_name, mangled_type);
+ sprintf (op_name, "operator %s", mangled_type);
/* Find or create an identifier. */
identifier = get_identifier (op_name);
/* Done with the temporary buffer. */
OpenPOWER on IntegriCloud