cp-tree.h, decl2.c: Remove support for -fall-virtual, -fenum-int-equivalence and -fno-nonnull-objects.

* cp-tree.h, decl2.c: Remove support for -fall-virtual,
	-fenum-int-equivalence and -fno-nonnull-objects.
	* class.c (check_for_override): Remove support for -fall-virtual.
	(finish_struct_1): Likewise.
	* call.c (build_new_op): Remove support for -fenum-int-equivalence.
	* typeck.c (build_binary_op_nodefault): Likewise.
	* cvt.c (ocp_convert): Likewise.
	* call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
	* class.c (build_vbase_path): Likewise.

From-SVN: r22131
This commit is contained in:
Jason Merrill 1998-08-31 08:54:18 -04:00
parent 058ebd7ee6
commit 84663f74ca
7 changed files with 34 additions and 105 deletions

View File

@ -1,3 +1,15 @@
1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h, decl2.c: Remove support for -fall-virtual,
-fenum-int-equivalence and -fno-nonnull-objects.
* class.c (check_for_override): Remove support for -fall-virtual.
(finish_struct_1): Likewise.
* call.c (build_new_op): Remove support for -fenum-int-equivalence.
* typeck.c (build_binary_op_nodefault): Likewise.
* cvt.c (ocp_convert): Likewise.
* call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
* class.c (build_vbase_path): Likewise.
Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
* Makefile.in (INTERFACE): New, set to 1.
@ -47,7 +59,7 @@ Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
* decl.c (finish_enum): Don't set the TREE_TYPE for the
enumeration constant values if we're processing_template_decls.
Don't set the type for the CONST_DECLs either; that's done in
build_enumerator.
build_enumerator.
(build_enumerator): Take the enumeration type as a
parameter.
* lex.c (do_identifier): Don't resolve enumeration constants while

View File

@ -96,13 +96,10 @@ build_vfield_ref (datum, type)
tree datum, type;
{
tree rval;
int old_assume_nonnull_objects = flag_assume_nonnull_objects;
if (datum == error_mark_node)
return error_mark_node;
/* Vtable references are always made from non-null objects. */
flag_assume_nonnull_objects = 1;
if (TREE_CODE (TREE_TYPE (datum)) == REFERENCE_TYPE)
datum = convert_from_reference (datum);
@ -111,7 +108,6 @@ build_vfield_ref (datum, type)
datum, CLASSTYPE_VFIELD (type));
else
rval = build_component_ref (datum, DECL_NAME (CLASSTYPE_VFIELD (type)), NULL_TREE, 0);
flag_assume_nonnull_objects = old_assume_nonnull_objects;
return rval;
}
@ -2795,8 +2791,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
case LE_EXPR:
case EQ_EXPR:
case NE_EXPR:
if (flag_int_enum_equivalence == 0
&& TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE
if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE
&& TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE
&& (TYPE_MAIN_VARIANT (TREE_TYPE (arg1))
!= TYPE_MAIN_VARIANT (TREE_TYPE (arg2))))

View File

@ -267,8 +267,7 @@ build_vbase_path (code, type, expr, path, nonnull)
ind = build_indirect_ref (nonnull_expr, NULL_PTR);
nonnull_expr = build_vbase_pointer (ind, last_virtual);
if (nonnull == 0
&& (TREE_CODE (type) == POINTER_TYPE
|| !flag_assume_nonnull_objects)
&& TREE_CODE (type) == POINTER_TYPE
&& null_expr == NULL_TREE)
{
null_expr = build1 (NOP_EXPR, build_pointer_type (last_virtual), integer_zero_node);
@ -2812,8 +2811,7 @@ check_for_override (decl, ctype)
for (i = 0; i < n_baselinks; i++)
{
tree base_binfo = TREE_VEC_ELT (binfos, i);
if (TYPE_VIRTUAL_P (BINFO_TYPE (base_binfo))
|| flag_all_virtual == 1)
if (TYPE_VIRTUAL_P (BINFO_TYPE (base_binfo)))
{
tree tmp = get_matching_virtual
(base_binfo, decl,
@ -3012,37 +3010,7 @@ extern int interface_only, interface_unknown;
TREE_LIST elements, whose TREE_PURPOSE field tells what access
the list has, and the TREE_VALUE slot gives the actual fields.
ATTRIBUTES is the set of decl attributes to be applied, if any.
If flag_all_virtual == 1, then we lay all functions into
the virtual function table, as though they were declared
virtual. Constructors do not lay down in the virtual function table.
If flag_all_virtual == 2, then we lay all functions into
the virtual function table, such that virtual functions
occupy a space by themselves, and then all functions
of the class occupy a space by themselves. This is illustrated
in the following diagram:
class A; class B : A;
Class A's vtbl: Class B's vtbl:
--------------------------------------------------------------------
| A's virtual functions| | B's virtual functions |
| | | (may inherit some from A). |
--------------------------------------------------------------------
| All of A's functions | | All of A's functions |
| (such as a->A::f). | | (such as b->A::f) |
--------------------------------------------------------------------
| B's new virtual functions |
| (not defined in A.) |
-------------------------------
| All of B's functions |
| (such as b->B::f) |
-------------------------------
this allows the program to make references to any function, virtual
or otherwise in a type-consistent manner. */
ATTRIBUTES is the set of decl attributes to be applied, if any. */
tree
finish_struct_1 (t, warn_anon)
@ -3055,7 +3023,6 @@ finish_struct_1 (t, warn_anon)
tree fields = TYPE_FIELDS (t);
tree fn_fields = TYPE_METHODS (t);
tree x, last_x, method_vec;
int all_virtual;
int has_virtual;
int max_has_virtual;
tree pending_virtuals = NULL_TREE;
@ -3173,13 +3140,6 @@ finish_struct_1 (t, warn_anon)
CLASSTYPE_VFIELDS (t) = vfields;
CLASSTYPE_VFIELD (t) = vfield;
if (IS_SIGNATURE (t))
all_virtual = 0;
else if (flag_all_virtual == 1)
all_virtual = 1;
else
all_virtual = 0;
for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
{
GNU_xref_member (current_class_name, x);
@ -3205,8 +3165,7 @@ finish_struct_1 (t, warn_anon)
/* The name of the field is the original field name
Save this in auxiliary field for later overloading. */
if (DECL_VINDEX (x)
|| (all_virtual == 1 && ! DECL_CONSTRUCTOR_P (x)))
if (DECL_VINDEX (x))
{
add_virtual_function (&pending_virtuals, &pending_hard_virtuals,
&has_virtual, x, t);

View File

@ -2186,24 +2186,11 @@ struct pending_inline
/* in method.c */
extern struct pending_inline *pending_inlines;
/* 1 for -fall-virtual: make every member function (except
constructors) lay down in the virtual function table.
Calls can then either go through the virtual function table or not,
depending on whether we know what function will actually be called. */
extern int flag_all_virtual;
/* Positive values means that we cannot make optimizing assumptions about
`this'. Negative values means we know `this' to be of static type. */
extern int flag_this_is_variable;
/* Controls whether enums and ints freely convert.
1 means with complete freedom.
0 means enums can convert to ints, but not vice-versa. */
extern int flag_int_enum_equivalence;
/* Nonzero means generate 'rtti' that give run-time type information. */
extern int flag_rtti;
@ -2564,7 +2551,6 @@ extern void cat_namespace_levels PROTO((void));
/* in decl2.c */
extern int check_java_method PROTO((tree, tree));
extern int flag_assume_nonnull_objects;
extern int lang_decode_option PROTO((int, char **));
extern tree grok_method_quals PROTO((tree, tree, tree));
extern void warn_if_unknown_interface PROTO((tree));
@ -2879,6 +2865,7 @@ extern void reinit_search_statistics PROTO((void));
extern tree current_scope PROTO((void));
extern tree lookup_conversions PROTO((tree));
extern tree get_template_base PROTO((tree, tree));
extern tree binfo_for_vtable PROTO((tree));
/* in semantics.c */
extern void finish_expr_stmt PROTO((tree));

View File

@ -700,8 +700,7 @@ ocp_convert (type, expr, convtype, flags)
tree intype = TREE_TYPE (e);
/* enum = enum, enum = int, enum = float, (enum)pointer are all
errors. */
if (flag_int_enum_equivalence == 0
&& TREE_CODE (type) == ENUMERAL_TYPE
if (TREE_CODE (type) == ENUMERAL_TYPE
&& ((ARITHMETIC_TYPE_P (intype) && ! (convtype & CONV_STATIC))
|| (TREE_CODE (intype) == POINTER_TYPE)))
{

View File

@ -330,13 +330,6 @@ int flag_labels_ok;
int flag_detailed_statistics;
/* C++ specific flags. */
/* Nonzero for -fall-virtual: make every member function (except
constructors) lay down in the virtual function table. Calls
can then either go through the virtual function table or not,
depending. */
int flag_all_virtual;
/* Zero means that `this' is a *const. This gives nice behavior in the
2.0 world. 1 gives 1.2-compatible behavior. 2 gives Spring behavior.
-2 means we're constructing an object and it has fixed type. */
@ -363,11 +356,6 @@ int flag_handle_signatures;
int flag_default_inline = 1;
/* Controls whether enums and ints freely convert.
1 means with complete freedom.
0 means enums can convert to ints, but not vice-versa. */
int flag_int_enum_equivalence;
/* Controls whether compiler generates 'type descriptor' that give
run-time type information. */
int flag_rtti = 1;
@ -376,18 +364,6 @@ int flag_rtti = 1;
for the GNU class browser. */
extern int flag_gnu_xref;
/* Nonzero if compiler can make `reasonable' assumptions about
references and objects. For example, the compiler must be
conservative about the following and not assume that `a' is nonnull:
obj &a = g ();
a.f (2);
In general, it is `reasonable' to assume that for many programs,
and better code can be generated in that case. */
int flag_assume_nonnull_objects = 1;
/* Nonzero if we want to support huge (> 2^(sizeof(short)*8-1) bytes)
objects. */
@ -482,17 +458,14 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
{"stats", &flag_detailed_statistics, 1},
{"this-is-variable", &flag_this_is_variable, 1},
{"strict-prototype", &flag_strict_prototype, 1},
{"all-virtual", &flag_all_virtual, 1},
{"elide-constructors", &flag_elide_constructors, 1},
{"handle-exceptions", &flag_exceptions, 1},
{"handle-signatures", &flag_handle_signatures, 1},
{"default-inline", &flag_default_inline, 1},
{"dollars-in-identifiers", &dollars_in_ident, 1},
{"enum-int-equiv", &flag_int_enum_equivalence, 1},
{"honor-std", &flag_honor_std, 1},
{"rtti", &flag_rtti, 1},
{"xref", &flag_gnu_xref, 1},
{"nonnull-objects", &flag_assume_nonnull_objects, 1},
{"implement-inlines", &flag_implement_inlines, 1},
{"external-templates", &flag_external_templates, 1},
{"implicit-templates", &flag_implicit_templates, 1},
@ -557,11 +530,23 @@ lang_decode_option (argc, argv)
if (!strcmp (p, "memoize-lookups")
|| !strcmp (p, "no-memoize-lookups")
|| !strcmp (p, "save-memoized")
|| !strcmp (p, "no-save-memoized"))
|| !strcmp (p, "no-save-memoized")
|| !strcmp (p, "no-all-virtual")
|| !strcmp (p, "no-enum-int-equiv")
|| !strcmp (p, "nonnull-objects")
|| !strcmp (p, "ansi-overloading"))
{
/* ignore */
found = 1;
}
else if (!strcmp (p, "all-virtual")
|| !strcmp (p, "enum-int-equiv")
|| !strcmp (p, "no-nonnull-objects")
|| !strcmp (p, "no-ansi-overloading"))
{
warning ("-f%s is no longer supported", p);
found = 1;
}
else if (! strcmp (p, "alt-external-templates"))
{
flag_external_templates = 1;
@ -590,13 +575,6 @@ lang_decode_option (argc, argv)
flag_guiding_decls = 0;
found = 1;
}
else if (!strcmp (p, "ansi-overloading"))
found = 1;
else if (!strcmp (p, "no-ansi-overloading"))
{
error ("-fno-ansi-overloading is no longer supported");
found = 1;
}
else if (!strcmp (p, "new-abi"))
{
flag_new_abi = 1;

View File

@ -3904,8 +3904,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
tree primop1 = get_narrower (op1, &unsignedp1);
/* Check for comparison of different enum types. */
if (flag_int_enum_equivalence == 0
&& TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE
if (TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE
&& TREE_CODE (TREE_TYPE (orig_op1)) == ENUMERAL_TYPE
&& TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0))
!= TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1)))