Commit 8fa33dfa by Mark Mitchell Committed by Mark Mitchell

invoke.texi (-fsquangle): Remove documentation.

	* invoke.texi (-fsquangle): Remove documentation.
	(-fname-mangling-version): Likewise.

	* cp-tree.h (new_abi_rtti_p): Remove.
	(name_mangling_version): Likewise.
	(flag_do_squangling): Likewise.
	* class.c (build_rtti_vtbl_entries): Remove old ABI support.
	* decl.c (grokfndecl): Likewise.
	* decl2.c (name_mangling_version): Remove.
	(flag_do_squangling): Likewise.
	(lang_f_options): Remove `squangle'.
	(unsupported_options): Add `squangle'.
	(cxx_decode_option): Issue a warning about uses of
	-fname-mangling-version.
	(finish_file): Remove old ABI support.
	* pt.c (check_explicit_specialization): Likewise.
	(tsubst_decl): Likewise.
	* rtti.c (init_rtti_processing): Likewise.
	(build_headof): Likewise.
	(get_tinfo_decl_dynamic): Likewise.
	(tinfo_from_decl): Likewise.
	(build_dynamic_cast_1): Likewise.
	(synthesize_tinfo_var): Likewise.
	* init.c (build_new): Allow enumeration types for the array-bounds
	in a direct-new-declarator.

From-SVN: r39845
parent e1078cfc
2001-02-17 Mark Mitchell <mark@codesourcery.com>
* invoke.texi (-fsquangle): Remove documentation.
(-fname-mangling-version): Likewise.
2001-02-18 Lars Brinkhoff <lars@nocrew.org> 2001-02-18 Lars Brinkhoff <lars@nocrew.org>
* optabs.c (expand_abs): Remove reference to * optabs.c (expand_abs): Remove reference to
......
...@@ -34,6 +34,26 @@ ...@@ -34,6 +34,26 @@
2001-02-17 Mark Mitchell <mark@codesourcery.com> 2001-02-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (new_abi_rtti_p): Remove.
(name_mangling_version): Likewise.
(flag_do_squangling): Likewise.
* class.c (build_rtti_vtbl_entries): Remove old ABI support.
* decl.c (grokfndecl): Likewise.
* decl2.c (name_mangling_version): Remove.
(flag_do_squangling): Likewise.
(lang_f_options): Remove `squangle'.
(unsupported_options): Add `squangle'.
(cxx_decode_option): Issue a warning about uses of
-fname-mangling-version.
(finish_file): Remove old ABI support.
* pt.c (check_explicit_specialization): Likewise.
(tsubst_decl): Likewise.
* rtti.c (init_rtti_processing): Likewise.
(build_headof): Likewise.
(get_tinfo_decl_dynamic): Likewise.
(tinfo_from_decl): Likewise.
(build_dynamic_cast_1): Likewise.
(synthesize_tinfo_var): Likewise.
* init.c (build_new): Allow enumeration types for the array-bounds * init.c (build_new): Allow enumeration types for the array-bounds
in a direct-new-declarator. in a direct-new-declarator.
......
...@@ -7766,35 +7766,16 @@ build_rtti_vtbl_entries (binfo, rtti_binfo, vid) ...@@ -7766,35 +7766,16 @@ build_rtti_vtbl_entries (binfo, rtti_binfo, vid)
} }
offset = size_diffop (BINFO_OFFSET (rtti_binfo), BINFO_OFFSET (b)); offset = size_diffop (BINFO_OFFSET (rtti_binfo), BINFO_OFFSET (b));
/* The second entry is, in the case of the new ABI, the address of /* The second entry is the address of the typeinfo object. */
the typeinfo object, or, in the case of the old ABI, a function if (flag_rtti)
which returns a typeinfo object. */ decl = build_unary_op (ADDR_EXPR, get_tinfo_decl (t), 0);
if (new_abi_rtti_p ())
{
if (flag_rtti)
decl = build_unary_op (ADDR_EXPR, get_tinfo_decl (t), 0);
else
decl = integer_zero_node;
/* Convert the declaration to a type that can be stored in the
vtable. */
init = build1 (NOP_EXPR, vfunc_ptr_type_node, decl);
TREE_CONSTANT (init) = 1;
}
else else
{ decl = integer_zero_node;
if (flag_rtti)
decl = get_tinfo_decl (t); /* Convert the declaration to a type that can be stored in the
else vtable. */
decl = abort_fndecl; init = build1 (NOP_EXPR, vfunc_ptr_type_node, decl);
TREE_CONSTANT (init) = 1;
/* Convert the declaration to a type that can be stored in the
vtable. */
init = build1 (ADDR_EXPR, vfunc_ptr_type_node, decl);
TREE_CONSTANT (init) = 1;
init = build_vtable_entry (offset, NULL_TREE, init,
/*generate_with_vtable_p=*/0);
}
*vid->last_init = build_tree_list (NULL_TREE, init); *vid->last_init = build_tree_list (NULL_TREE, init);
vid->last_init = &TREE_CHAIN (*vid->last_init); vid->last_init = &TREE_CHAIN (*vid->last_init);
......
...@@ -261,11 +261,6 @@ extern int flag_huge_objects; ...@@ -261,11 +261,6 @@ extern int flag_huge_objects;
class). */ class). */
#define all_overridden_vfuns_in_vtables_p() (1) #define all_overridden_vfuns_in_vtables_p() (1)
/* Nonzero if we use access type_info objects directly, and use the
cross-vendor layout for them. Zero if we use an accessor function
to get the type_info object address. */
#define new_abi_rtti_p() (1)
/* Nonzero if primary and secondary vtables are combined into a single /* Nonzero if primary and secondary vtables are combined into a single
vtable. */ vtable. */
#define merge_primary_and_secondary_vtables_p() (1) #define merge_primary_and_secondary_vtables_p() (1)
...@@ -1121,15 +1116,6 @@ extern int flag_ansi; ...@@ -1121,15 +1116,6 @@ extern int flag_ansi;
extern int flag_default_inline; extern int flag_default_inline;
/* The name-mangling scheme to use. Versions of gcc before 2.8 use
version 0. */
extern int name_mangling_version;
/* Nonzero if squashed mangling is to be performed.
This uses the B and K codes to reference previously seen class types
and class qualifiers. */
extern int flag_do_squangling;
/* Nonzero means generate separate instantiation control files and juggle /* Nonzero means generate separate instantiation control files and juggle
them at link time. */ them at link time. */
extern int flag_use_repository; extern int flag_use_repository;
......
...@@ -8862,7 +8862,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, ...@@ -8862,7 +8862,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
/* Plain overloading: will not be grok'd by grokclassfn. */ /* Plain overloading: will not be grok'd by grokclassfn. */
if (! ctype && ! processing_template_decl if (! ctype && ! processing_template_decl
&& (! DECL_EXTERN_C_P (decl) || DECL_OVERLOADED_OPERATOR_P (decl)) && (! DECL_EXTERN_C_P (decl) || DECL_OVERLOADED_OPERATOR_P (decl))
&& (! DECL_USE_TEMPLATE (decl) || name_mangling_version < 1)) && ! DECL_USE_TEMPLATE (decl))
set_mangled_name_for_decl (decl); set_mangled_name_for_decl (decl);
if (funcdef_flag) if (funcdef_flag)
......
...@@ -430,17 +430,6 @@ int flag_inline_trees = 0; ...@@ -430,17 +430,6 @@ int flag_inline_trees = 0;
int max_tinst_depth = 50; int max_tinst_depth = 50;
/* The name-mangling scheme to use. Must be 1 or greater to support
template functions with identical types, but different template
arguments. */
int name_mangling_version = 2;
/* Nonzero if squashed mangling is to be performed.
This uses the B and K codes to reference previously seen class types
and class qualifiers. */
int flag_do_squangling;
/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */ /* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
int flag_vtable_gc; int flag_vtable_gc;
...@@ -507,7 +496,6 @@ lang_f_options[] = ...@@ -507,7 +496,6 @@ lang_f_options[] =
{"permissive", &flag_permissive, 1}, {"permissive", &flag_permissive, 1},
{"repo", &flag_use_repository, 1}, {"repo", &flag_use_repository, 1},
{"rtti", &flag_rtti, 1}, {"rtti", &flag_rtti, 1},
{"squangle", &flag_do_squangling, 1},
{"stats", &flag_detailed_statistics, 1}, {"stats", &flag_detailed_statistics, 1},
{"use-cxa-atexit", &flag_use_cxa_atexit, 1}, {"use-cxa-atexit", &flag_use_cxa_atexit, 1},
{"vtable-gc", &flag_vtable_gc, 1}, {"vtable-gc", &flag_vtable_gc, 1},
...@@ -525,8 +513,9 @@ static const char * const unsupported_options[] = { ...@@ -525,8 +513,9 @@ static const char * const unsupported_options[] = {
"enum-int-equiv", "enum-int-equiv",
"guiding-decls", "guiding-decls",
"nonnull-objects", "nonnull-objects",
"this-is-variable", "squangle",
"strict-prototype", "strict-prototype",
"this-is-variable",
}; };
/* Compare two option strings, pointed two by P1 and P2, for use with /* Compare two option strings, pointed two by P1 and P2, for use with
...@@ -617,8 +606,10 @@ cxx_decode_option (argc, argv) ...@@ -617,8 +606,10 @@ cxx_decode_option (argc, argv)
= read_integral_parameter (option_value, p - 2, max_tinst_depth); = read_integral_parameter (option_value, p - 2, max_tinst_depth);
else if ((option_value else if ((option_value
= skip_leading_substring (p, "name-mangling-version-"))) = skip_leading_substring (p, "name-mangling-version-")))
name_mangling_version {
= read_integral_parameter (option_value, p - 2, name_mangling_version); warning ("-fname-mangling-version is no longer supported");
return 1;
}
else if ((option_value else if ((option_value
= skip_leading_substring (p, "dump-translation-unit="))) = skip_leading_substring (p, "dump-translation-unit=")))
{ {
...@@ -3581,8 +3572,7 @@ finish_file () ...@@ -3581,8 +3572,7 @@ finish_file ()
timevar_push (TV_VARCONST); timevar_push (TV_VARCONST);
if (new_abi_rtti_p ()) emit_support_tinfos ();
emit_support_tinfos ();
do do
{ {
...@@ -3602,8 +3592,7 @@ finish_file () ...@@ -3602,8 +3592,7 @@ finish_file ()
/* Write out needed type info variables. Writing out one variable /* Write out needed type info variables. Writing out one variable
might cause others to be needed. */ might cause others to be needed. */
if (new_abi_rtti_p () if (walk_globals (tinfo_decl_p, emit_tinfo_decl, /*data=*/0))
&& walk_globals (tinfo_decl_p, emit_tinfo_decl, /*data=*/0))
reconsider = 1; reconsider = 1;
/* The list of objects with static storage duration is built up /* The list of objects with static storage duration is built up
......
...@@ -1693,8 +1693,7 @@ check_explicit_specialization (declarator, decl, template_count, flags) ...@@ -1693,8 +1693,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
treatment. We do this here so that the ordinary, treatment. We do this here so that the ordinary,
non-template, name-mangling algorithm will not be used non-template, name-mangling algorithm will not be used
later. */ later. */
if ((is_member_template (tmpl) || ctype == NULL_TREE) if (is_member_template (tmpl) || ctype == NULL_TREE)
&& name_mangling_version >= 1)
set_mangled_name_for_template_decl (decl); set_mangled_name_for_template_decl (decl);
if (is_friend && !have_def) if (is_friend && !have_def)
...@@ -5879,8 +5878,7 @@ tsubst_decl (t, args, type) ...@@ -5879,8 +5878,7 @@ tsubst_decl (t, args, type)
/* TMPL will be NULL if this is a specialization of a /* TMPL will be NULL if this is a specialization of a
member function of a template class. */ member function of a template class. */
if (name_mangling_version < 1 if (tmpl == NULL_TREE
|| tmpl == NULL_TREE
|| (member && !is_member_template (tmpl) || (member && !is_member_template (tmpl)
&& !DECL_TEMPLATE_INFO (tmpl))) && !DECL_TEMPLATE_INFO (tmpl)))
set_mangled_name_for_decl (r); set_mangled_name_for_decl (r);
......
...@@ -79,24 +79,11 @@ init_rtti_processing () ...@@ -79,24 +79,11 @@ init_rtti_processing ()
(class_type_node, get_identifier ("type_info"), 1); (class_type_node, get_identifier ("type_info"), 1);
if (flag_honor_std) if (flag_honor_std)
pop_namespace (); pop_namespace ();
if (!new_abi_rtti_p ()) /* FIXME: These identifier prefixes are not set in stone yet. */
{ tinfo_decl_id = get_identifier ("__ti");
tinfo_decl_id = get_identifier ("__tf"); tinfo_var_id = get_identifier ("__tn");
tinfo_decl_type = build_function_type tinfo_decl_type =
(build_reference_type build_qualified_type (type_info_type_node, TYPE_QUAL_CONST);
(build_qualified_type
(type_info_type_node, TYPE_QUAL_CONST)),
void_list_node);
tinfo_var_id = get_identifier ("__ti");
}
else
{
/* FIXME: These identifier prefixes are not set in stone yet. */
tinfo_decl_id = get_identifier ("__ti");
tinfo_var_id = get_identifier ("__tn");
tinfo_decl_type = build_qualified_type
(type_info_type_node, TYPE_QUAL_CONST);
}
} }
/* Given a pointer to an object with at least one virtual table /* Given a pointer to an object with at least one virtual table
...@@ -150,11 +137,7 @@ build_headof (exp) ...@@ -150,11 +137,7 @@ build_headof (exp)
/* Under the new ABI, the offset-to-top field is at index -2 from /* Under the new ABI, the offset-to-top field is at index -2 from
the vptr. */ the vptr. */
if (new_abi_rtti_p ()) index = build_int_2 (-2, -1);
index = build_int_2 (-2, -1);
/* But under the old ABI, it is at offset zero. */
else
index = integer_zero_node;
aref = build_vtbl_ref (build_indirect_ref (exp, NULL_PTR), index); aref = build_vtbl_ref (build_indirect_ref (exp, NULL_PTR), index);
...@@ -253,14 +236,8 @@ get_tinfo_decl_dynamic (exp) ...@@ -253,14 +236,8 @@ get_tinfo_decl_dynamic (exp)
exp = build_indirect_ref (exp, NULL_PTR); exp = build_indirect_ref (exp, NULL_PTR);
} }
/* The RTTI information is always in the vtable, but it's at /* The RTTI information is at index -1. */
different indices depending on the ABI. */ index = integer_minus_one_node;
if (new_abi_rtti_p ())
index = integer_minus_one_node;
else if (flag_vtable_thunks)
index = integer_one_node;
else
index = integer_zero_node;
t = build_vfn_ref ((tree *) 0, exp, index); t = build_vfn_ref ((tree *) 0, exp, index);
TREE_TYPE (t) = build_pointer_type (tinfo_decl_type); TREE_TYPE (t) = build_pointer_type (tinfo_decl_type);
return t; return t;
...@@ -397,9 +374,7 @@ tinfo_from_decl (expr) ...@@ -397,9 +374,7 @@ tinfo_from_decl (expr)
{ {
tree t; tree t;
if (!new_abi_rtti_p ()) if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
t = build_call (expr, NULL_TREE);
else if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
t = build_indirect_ref (expr, NULL); t = build_indirect_ref (expr, NULL);
else else
t = expr; t = expr;
...@@ -717,67 +692,34 @@ build_dynamic_cast_1 (type, expr) ...@@ -717,67 +692,34 @@ build_dynamic_cast_1 (type, expr)
if (tc == REFERENCE_TYPE) if (tc == REFERENCE_TYPE)
expr1 = build_unary_op (ADDR_EXPR, expr1, 0); expr1 = build_unary_op (ADDR_EXPR, expr1, 0);
if (!new_abi_rtti_p ()) elems = tree_cons
{ (NULL_TREE, expr1, tree_cons
tree expr2 = build_headof (expr1); (NULL_TREE, td3, tree_cons
tree td1 = expr; (NULL_TREE, td2, tree_cons
(NULL_TREE, boff, NULL_TREE))));
if (tc == POINTER_TYPE)
td1 = build_indirect_ref (td1, NULL_PTR);
td1 = get_tinfo_decl_dynamic (td1);
elems = tree_cons
(NULL_TREE, td1, tree_cons
(NULL_TREE, td2, tree_cons
(NULL_TREE, boff, tree_cons
(NULL_TREE, expr2, tree_cons
(NULL_TREE, td3, tree_cons
(NULL_TREE, expr1, NULL_TREE))))));
}
else
elems = tree_cons
(NULL_TREE, expr1, tree_cons
(NULL_TREE, td3, tree_cons
(NULL_TREE, td2, tree_cons
(NULL_TREE, boff, NULL_TREE))));
dcast_fn = dynamic_cast_node; dcast_fn = dynamic_cast_node;
if (!dcast_fn) if (!dcast_fn)
{ {
tree tmp; tree tmp;
tree tinfo_ptr; tree tinfo_ptr;
tree ns = new_abi_rtti_p () ? abi_node : global_namespace; tree ns = abi_node;
const char *name; const char *name;
push_nested_namespace (ns); push_nested_namespace (ns);
if (!new_abi_rtti_p ()) tinfo_ptr = xref_tag (class_type_node,
{ get_identifier ("__class_type_info"),
tinfo_ptr = build_pointer_type (tinfo_decl_type); 1);
name = "__dynamic_cast_2";
tmp = tree_cons tinfo_ptr = build_pointer_type
(NULL_TREE, tinfo_ptr, tree_cons (build_qualified_type
(NULL_TREE, tinfo_ptr, tree_cons (tinfo_ptr, TYPE_QUAL_CONST));
(NULL_TREE, integer_type_node, tree_cons name = "__dynamic_cast";
(NULL_TREE, ptr_type_node, tree_cons tmp = tree_cons
(NULL_TREE, tinfo_ptr, tree_cons (NULL_TREE, const_ptr_type_node, tree_cons
(NULL_TREE, ptr_type_node, void_list_node)))))); (NULL_TREE, tinfo_ptr, tree_cons
} (NULL_TREE, tinfo_ptr, tree_cons
else (NULL_TREE, ptrdiff_type_node, void_list_node))));
{
tinfo_ptr = xref_tag (class_type_node,
get_identifier ("__class_type_info"),
1);
tinfo_ptr = build_pointer_type
(build_qualified_type
(tinfo_ptr, TYPE_QUAL_CONST));
name = "__dynamic_cast";
tmp = tree_cons
(NULL_TREE, const_ptr_type_node, tree_cons
(NULL_TREE, tinfo_ptr, tree_cons
(NULL_TREE, tinfo_ptr, tree_cons
(NULL_TREE, ptrdiff_type_node, void_list_node))));
}
tmp = build_function_type (ptr_type_node, tmp); tmp = build_function_type (ptr_type_node, tmp);
dcast_fn = build_library_fn_ptr (name, tmp); dcast_fn = build_library_fn_ptr (name, tmp);
pop_nested_namespace (ns); pop_nested_namespace (ns);
...@@ -1134,8 +1076,6 @@ synthesize_tinfo_var (target_type, real_name) ...@@ -1134,8 +1076,6 @@ synthesize_tinfo_var (target_type, real_name)
tree var_type = NULL_TREE; tree var_type = NULL_TREE;
int non_public = 0; int non_public = 0;
my_friendly_assert (new_abi_rtti_p (), 20000118);
switch (TREE_CODE (target_type)) switch (TREE_CODE (target_type))
{ {
case POINTER_TYPE: case POINTER_TYPE:
......
...@@ -173,9 +173,9 @@ in the following sections. ...@@ -173,9 +173,9 @@ in the following sections.
-fhuge-objects -fno-implicit-templates @gol -fhuge-objects -fno-implicit-templates @gol
-fno-implicit-inline-templates @gol -fno-implicit-inline-templates @gol
-fno-implement-inlines -fms-extensions @gol -fno-implement-inlines -fms-extensions @gol
-fname-mangling-version-@var{n} -fno-operator-names @gol -fno-operator-names @gol
-fno-optional-diags -fpermissive @gol -fno-optional-diags -fpermissive @gol
-frepo -fno-rtti -fsquangle -ftemplate-depth-@var{n} @gol -frepo -fno-rtti -ftemplate-depth-@var{n} @gol
-fuse-cxa-atexit -fvtable-thunks -nostdinc++ @gol -fuse-cxa-atexit -fvtable-thunks -nostdinc++ @gol
-fno-default-inline -Wctor-dtor-privacy @gol -fno-default-inline -Wctor-dtor-privacy @gol
-Wnon-virtual-dtor -Wreorder @gol -Wnon-virtual-dtor -Wreorder @gol
...@@ -1318,20 +1318,6 @@ errors if these functions are not inlined everywhere they are called. ...@@ -1318,20 +1318,6 @@ errors if these functions are not inlined everywhere they are called.
Disable pedantic warnings about constructs used in MFC, such as implicit Disable pedantic warnings about constructs used in MFC, such as implicit
int and getting a pointer to member function via non-standard syntax. int and getting a pointer to member function via non-standard syntax.
@item -fname-mangling-version-@var{n}
Control the way in which names are mangled. Version 0 is compatible
with versions of g++ before 2.8. Version 1 is the default. Version 1
will allow correct mangling of function templates. For example,
version 0 mangling does not mangle foo<int, double> and foo<int, char>
given this declaration:
@example
template <class T, class U> void foo(T t);
@end example
Like all options that change the ABI, all C++ code, @emph{including
libgcc} must be built with the same setting of this option.
@item -fno-operator-names @item -fno-operator-names
Do not treat the operator name keywords @code{and}, @code{bitand}, Do not treat the operator name keywords @code{and}, @code{bitand},
@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
...@@ -1361,18 +1347,6 @@ of the language, you can save some space by using this flag. Note that ...@@ -1361,18 +1347,6 @@ of the language, you can save some space by using this flag. Note that
exception handling uses the same information, but it will generate it as exception handling uses the same information, but it will generate it as
needed. needed.
@item -fsquangle
@itemx -fno-squangle
@samp{-fsquangle} will enable a compressed form of name mangling for
identifiers. In particular, it helps to shorten very long names by recognizing
types and class names which occur more than once, replacing them with special
short ID codes. This option also requires any C++ libraries being used to
be compiled with this option as well. The compiler has this disabled (the
equivalent of @samp{-fno-squangle}) by default.
Like all options that change the ABI, all C++ code, @emph{including
libgcc.a} must be built with the same setting of this option.
@item -ftemplate-depth-@var{n} @item -ftemplate-depth-@var{n}
Set the maximum instantiation depth for template classes to @var{n}. Set the maximum instantiation depth for template classes to @var{n}.
A limit on the template instantiation depth is needed to detect A limit on the template instantiation depth is needed to detect
......
// Test for proper mangling by setting up name clashes. // Test for proper mangling by setting up name clashes.
// Special g++ Options: -fno-squangle
#if (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100) #if (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100)
#define NAME(OLD, NEW) OLD #define NAME(OLD, NEW) OLD
......
// Build don't link: // Build don't link:
// Special g++ Options: -fno-squangle
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
#if (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100) #if (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment