Commit 9e9ff709 by Mike Stump

80th Cygnus<->FSF merge

From-SVN: r11150
parent 96bb8ed3
......@@ -86,9 +86,9 @@ $(DEMANGLER_PROG): cxxmain.o underscore.o getopt.o getopt1.o $(LIBDEPS)
CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
$(srcdir)/cp/except.c $(srcdir)/cp/input.c $(srcdir)/cp/pt.c \
$(srcdir)/cp/spew.c $(srcdir)/cp/xref.c $(srcdir)/cp/class.c \
$(srcdir)/cp/edsel.c $(srcdir)/cp/expr.c $(srcdir)/cp/lex.c \
$(srcdir)/cp/expr.c $(srcdir)/cp/lex.c \
$(srcdir)/cp/ptree.c $(srcdir)/cp/tree.c $(srcdir)/cp/cvt.c \
$(srcdir)/cp/errfn.c $(srcdir)/cp/gc.c $(srcdir)/cp/method.c \
$(srcdir)/cp/errfn.c $(srcdir)/cp/rtti.c $(srcdir)/cp/method.c \
$(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \
$(srcdir)/cp/error.c $(srcdir)/cp/init.c $(srcdir)/cp/parse.y \
$(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c $(srcdir)/cp/repo.c
......
......@@ -159,8 +159,8 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
# Language-specific object files for g++
CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
class.o decl2.o error.o gc.o lex.o parse.o ptree.o spew.o typeck.o cvt.o \
edsel.o except.o init.o method.o search.o tree.o xref.o repo.o
class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
except.o init.o method.o search.o tree.o xref.o repo.o
# Language-independent object files.
OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
......@@ -238,11 +238,10 @@ cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) class.h
search.o : search.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
ptree.o : ptree.c $(CONFIG_H) $(CXX_TREE_H)
gc.o : gc.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
rtti.o : rtti.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
except.o : except.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H)
expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../expr.h ../insn-codes.h
edsel.o : edsel.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h
pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(PARSE_H)
error.o : error.c $(CONFIG_H) $(CXX_TREE_H)
......
......@@ -2697,6 +2697,167 @@ merge_overrides (binfo, old, do_self, t)
}
}
/* Get the base virtual function declarations in T that are either
overridden or hidden by FNDECL as a list. We set TREE_PURPOSE with
the overrider/hider. */
tree
get_basefndecls (fndecl, t)
tree fndecl, t;
{
tree methods = TYPE_METHODS (t);
tree base_fndecls = NULL_TREE;
tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0;
while (methods)
{
tree purpose = NULL_TREE;
if (TREE_CODE (methods) == FUNCTION_DECL
&& DECL_VINDEX (methods) != NULL_TREE
&& DECL_NAME (fndecl) == DECL_NAME (methods))
base_fndecls = temp_tree_cons (fndecl, methods, base_fndecls);
methods = TREE_CHAIN (methods);
}
if (base_fndecls)
return base_fndecls;
for (i = 0; i < n_baseclasses; i++)
{
tree base_binfo = TREE_VEC_ELT (binfos, i);
tree basetype = BINFO_TYPE (base_binfo);
tree methods = TYPE_METHODS (basetype);
base_fndecls = chainon (get_basefndecls (fndecl, basetype),
base_fndecls);
}
return base_fndecls;
}
/* Mark the functions that have been hidden with their overriders.
Since we start out with all functions already marked with a hider,
no need to mark functions that are just hidden. */
void
mark_overriders (fndecl, base_fndecls)
tree fndecl, base_fndecls;
{
while (base_fndecls)
{
if (overrides (TREE_VALUE (base_fndecls), fndecl))
TREE_PURPOSE (base_fndecls) = fndecl;
base_fndecls = TREE_CHAIN (base_fndecls);
}
}
/* Warn about hidden virtual functions that are not overridden in t. */
void
warn_hidden (t)
tree t;
{
tree method_vec = CLASSTYPE_METHOD_VEC (t);
int n_methods = method_vec ? TREE_VEC_LENGTH (method_vec) : 0;
int i;
/* We go through each separately named virtual function. */
for (i = 1; i < n_methods; ++i)
{
tree fndecl = TREE_VEC_ELT (method_vec, i);
tree base_fndecls = NULL_TREE;
tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0;
if (DECL_VINDEX (fndecl) == NULL_TREE)
continue;
/* First we get a list of all possible functions that might be
hidden from each base class. */
for (i = 0; i < n_baseclasses; i++)
{
tree base_binfo = TREE_VEC_ELT (binfos, i);
tree basetype = BINFO_TYPE (base_binfo);
base_fndecls = chainon (get_basefndecls (fndecl, basetype),
base_fndecls);
}
if (TREE_CHAIN (fndecl)
&& DECL_NAME (TREE_CHAIN (fndecl)) == DECL_NAME (fndecl))
fndecl = TREE_CHAIN (fndecl);
else
fndecl = NULL_TREE;
/* ...then mark up all the base functions with overriders, preferring
overriders to hiders. */
if (base_fndecls)
while (fndecl)
{
mark_overriders (fndecl, base_fndecls);
if (TREE_CHAIN (fndecl)
&& DECL_NAME (TREE_CHAIN (fndecl)) == DECL_NAME (fndecl))
fndecl = TREE_CHAIN (fndecl);
else
fndecl = NULL_TREE;
}
/* Now give a warning for all base functions without overriders,
as they are hidden. */
while (base_fndecls)
{
if (! overrides (TREE_VALUE (base_fndecls),
TREE_PURPOSE (base_fndecls)))
{
/* Here we know it is a hider, and no overrider exists. */
cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls));
cp_warning_at (" by `%D'", TREE_PURPOSE (base_fndecls));
}
base_fndecls = TREE_CHAIN (base_fndecls);
}
}
}
/* Check for things that are invalid. There are probably plenty of other
things we should check for also. */
static void
finish_struct_anon (t)
tree t;
{
tree field;
for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
{
if (TREE_STATIC (field))
continue;
if (TREE_CODE (field) != FIELD_DECL)
continue;
if (DECL_NAME (field) == NULL_TREE
&& TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
{
tree* uelt = &TYPE_FIELDS (TREE_TYPE (field));
for (; *uelt; uelt = &TREE_CHAIN (*uelt))
{
tree offset, x;
if (TREE_CODE (*uelt) != FIELD_DECL)
continue;
if (TREE_PRIVATE (*uelt))
cp_pedwarn_at ("private member `%#D' in anonymous union",
*uelt);
else if (TREE_PROTECTED (*uelt))
cp_pedwarn_at ("protected member `%#D' in anonymous union",
*uelt);
}
}
}
}
extern int interface_only, interface_unknown;
/* Create a RECORD_TYPE or UNION_TYPE node for a C struct or union declaration
......@@ -3577,52 +3738,7 @@ finish_struct_1 (t, warn_anon)
layout_type (t);
{
tree field;
for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
{
if (TREE_STATIC (field))
continue;
if (TREE_CODE (field) != FIELD_DECL)
continue;
/* If this field is an anonymous union,
give each union-member the same position as the union has.
??? This is a real kludge because it makes the structure
of the types look strange. This feature is only used by
C++, which should have build_component_ref build two
COMPONENT_REF operations, one for the union and one for
the inner field. We set the offset of this field to zero
so that either the old or the correct method will work.
Setting DECL_FIELD_CONTEXT is wrong unless the inner fields are
moved into the type of this field, but nothing seems to break
by doing this. */
if (DECL_NAME (field) == NULL_TREE
&& TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
{
tree uelt = TYPE_FIELDS (TREE_TYPE (field));
for (; uelt; uelt = TREE_CHAIN (uelt))
{
if (TREE_CODE (uelt) != FIELD_DECL)
continue;
if (TREE_PRIVATE (uelt))
cp_pedwarn_at ("private member `%#D' in anonymous union",
uelt);
else if (TREE_PROTECTED (uelt))
cp_pedwarn_at ("protected member `%#D' in anonymous union",
uelt);
DECL_FIELD_CONTEXT (uelt) = DECL_FIELD_CONTEXT (field);
DECL_FIELD_BITPOS (uelt) = DECL_FIELD_BITPOS (field);
}
DECL_FIELD_BITPOS (field) = integer_zero_node;
}
}
}
finish_struct_anon (t);
if (n_baseclasses)
TYPE_FIELDS (t) = TREE_CHAIN (TYPE_FIELDS (t));
......@@ -4001,8 +4117,8 @@ finish_struct_1 (t, warn_anon)
resume_momentary (old);
if (flag_cadillac)
cadillac_finish_struct (t);
if (warn_overloaded_virtual)
warn_hidden (t);
#if 0
/* This has to be done after we have sorted out what to do with
......@@ -4453,9 +4569,6 @@ pushclass (type, modify)
current_function_decl = this_fndecl;
}
if (flag_cadillac)
cadillac_push_class (type);
}
/* Get out of the current class scope. If we were in a class scope
......@@ -4466,9 +4579,6 @@ void
popclass (modify)
int modify;
{
if (flag_cadillac)
cadillac_pop_class ();
if (modify < 0)
{
/* Back this old class out completely. */
......@@ -4589,18 +4699,12 @@ push_lang_context (name)
}
else
error ("language string `\"%s\"' not recognized", IDENTIFIER_POINTER (name));
if (flag_cadillac)
cadillac_push_lang (name);
}
/* Get out of the current language scope. */
void
pop_lang_context ()
{
if (flag_cadillac)
cadillac_pop_lang ();
current_lang_name = *--current_lang_stack;
if (current_lang_name == lang_name_cplusplus)
strict_prototype = strict_prototypes_lang_cplusplus;
......
......@@ -298,10 +298,6 @@ extern int flag_handle_signatures;
inline by default. */
extern int flag_default_inline;
/* Nonzero means emit cadillac protocol. */
extern int flag_cadillac;
/* C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
......@@ -1318,9 +1314,6 @@ extern int flag_new_for_scope;
#define DECL_REFERENCE_SLOT(NODE) ((tree)(NODE)->decl.arguments)
#define SET_DECL_REFERENCE_SLOT(NODE,VAL) ((NODE)->decl.arguments=VAL)
/* For local VAR_DECLs, holds index into gc-protected obstack. */
#define DECL_GC_OFFSET(NODE) ((NODE)->decl.result)
/* Accessor macros for C++ template decl nodes. */
#define DECL_TEMPLATE_IS_CLASS(NODE) (DECL_RESULT(NODE) == NULL_TREE)
#define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
......@@ -1779,10 +1772,6 @@ extern int flag_this_is_variable;
extern int flag_int_enum_equivalence;
/* Nonzero means layout structures so that we can do garbage collection. */
extern int flag_gc;
/* Nonzero means generate 'rtti' that give run-time type information. */
extern int flag_rtti;
......@@ -1810,14 +1799,6 @@ extern int flag_implicit_templates;
extern int flag_weak;
/* Current end of entries in the gc obstack for stack pointer variables. */
extern int current_function_obstack_index;
/* Flag saying whether we have used the obstack in this function or not. */
extern int current_function_obstack_usage;
enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
extern tree current_class_decl, C_C_D; /* PARM_DECL: the class instance variable */
......@@ -2082,7 +2063,6 @@ extern tree grokfield PROTO((tree, tree, tree, tree, tree, tree));
extern tree grokbitfield PROTO((tree, tree, tree));
extern tree groktypefield PROTO((tree, tree));
extern tree grokoptypename PROTO((tree, tree));
extern tree build_push_scope PROTO((tree, tree));
extern void cplus_decl_attributes PROTO((tree, tree, tree));
extern tree constructor_name_full PROTO((tree));
extern tree constructor_name PROTO((tree));
......@@ -2113,8 +2093,6 @@ extern tree current_namespace_id PROTO((tree));
extern tree get_namespace_id PROTO((void));
extern void check_default_args PROTO((tree));
/* in edsel.c */
/* in except.c */
extern tree protect_list;
extern void start_protect PROTO((void));
......@@ -2145,19 +2123,12 @@ extern void fixup_result_decl PROTO((tree, struct rtx_def *));
extern int decl_in_memory_p PROTO((tree));
extern tree unsave_expr_now PROTO((tree));
/* in gc.c */
extern int type_needs_gc_entry PROTO((tree));
extern int value_safe_from_gc PROTO((tree, tree));
extern void build_static_gc_entry PROTO((tree, tree));
extern tree protect_value_from_gc PROTO((tree, tree));
/* in rtti.c */
extern tree build_headof PROTO((tree));
extern tree build_classof PROTO((tree));
extern tree build_t_desc PROTO((tree, int));
extern tree build_i_desc PROTO((tree));
extern tree build_m_desc PROTO((tree));
extern void expand_gc_prologue_and_epilogue PROTO((void));
extern void lang_expand_end_bindings PROTO((struct rtx_def *, struct rtx_def *));
extern void init_gc_processing PROTO((void));
extern tree build_typeid PROTO((tree));
extern tree get_typeid PROTO((tree));
extern tree build_dynamic_cast PROTO((tree, tree));
......@@ -2174,7 +2145,6 @@ extern tree get_aggr_from_typedef PROTO((tree, int));
extern tree get_type_value PROTO((tree));
extern tree build_member_call PROTO((tree, tree, tree));
extern tree build_offset_ref PROTO((tree, tree));
extern tree get_member_function PROTO((tree *, tree, tree));
extern tree get_member_function_from_ptrfunc PROTO((tree *, tree));
extern tree resolve_offset_ref PROTO((tree));
extern tree decl_constant_value PROTO((tree));
......@@ -2316,14 +2286,13 @@ extern tree lookup_nested_field PROTO((tree, int));
extern tree lookup_fnfields PROTO((tree, tree, int));
extern tree lookup_nested_tag PROTO((tree, tree));
extern HOST_WIDE_INT breadth_first_search PROTO((tree, int (*)(), int (*)()));
extern int tree_needs_constructor_p PROTO((tree, int));
extern int tree_has_any_destructor_p PROTO((tree, int));
extern tree get_matching_virtual PROTO((tree, tree, int));
extern tree get_abstract_virtuals PROTO((tree));
extern tree get_baselinks PROTO((tree, tree, tree));
extern tree next_baselink PROTO((tree));
extern tree init_vbase_pointers PROTO((tree, tree));
extern void expand_indirect_vtbls_init PROTO((tree, tree, tree, int));
extern void expand_indirect_vtbls_init PROTO((tree, tree, tree));
extern void clear_search_slots PROTO((tree));
extern tree get_vbase_types PROTO((tree));
extern void build_mi_matrix PROTO((tree));
......@@ -2375,19 +2344,15 @@ extern tree hash_tree_cons PROTO((int, int, int, tree, tree, tree));
extern tree hash_tree_chain PROTO((tree, tree));
extern tree hash_chainon PROTO((tree, tree));
extern tree get_decl_list PROTO((tree));
extern tree list_hash_lookup_or_cons PROTO((tree));
extern tree make_binfo PROTO((tree, tree, tree, tree, tree));
extern tree binfo_value PROTO((tree, tree));
extern tree reverse_path PROTO((tree));
extern tree virtual_member PROTO((tree, tree));
extern void debug_binfo PROTO((tree));
extern int decl_list_length PROTO((tree));
extern int count_functions PROTO((tree));
extern tree decl_value_member PROTO((tree, tree));
extern int is_overloaded_fn PROTO((tree));
extern tree get_first_fn PROTO((tree));
extern tree fnaddr_from_vtable_entry PROTO((tree));
extern void set_fnaddr_from_vtable_entry PROTO((tree, tree));
extern tree function_arg_chain PROTO((tree));
extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
extern int is_aggr_type_2 PROTO((tree, tree));
......
......@@ -590,15 +590,7 @@ build_up_reference (type, arg, flags, checkconst)
{
tree temp;
if (flags&INDIRECT_BIND)
{
tree slot = build (VAR_DECL, argtype);
layout_decl (slot, 0);
rval = build (TARGET_EXPR, argtype, slot, arg, 0);
rval = build1 (ADDR_EXPR, type, rval);
goto done;
}
else if (TREE_CODE (targ) == CALL_EXPR && IS_AGGR_TYPE (argtype))
if (TREE_CODE (targ) == CALL_EXPR && IS_AGGR_TYPE (argtype))
{
temp = build_cplus_new (argtype, targ, 1);
if (TREE_CODE (temp) == WITH_CLEANUP_EXPR)
......@@ -609,6 +601,17 @@ build_up_reference (type, arg, flags, checkconst)
rval = build1 (ADDR_EXPR, type, temp);
goto done;
}
else if (flags&INDIRECT_BIND)
{
/* This should be the default, not the below code. */
/* All callers except grok_reference_init should probably
use INDIRECT_BIND. */
tree slot = build (VAR_DECL, argtype);
layout_decl (slot, 0);
rval = build (TARGET_EXPR, argtype, slot, arg, 0);
rval = build1 (ADDR_EXPR, type, rval);
goto done;
}
else
{
temp = get_temp_name (argtype, 0);
......
......@@ -306,14 +306,6 @@ int flag_default_inline = 1;
0 means enums can convert to ints, but not vice-versa. */
int flag_int_enum_equivalence;
/* Controls whether compiler is operating under LUCID's Cadillac
system. 1 means yes, 0 means no. */
int flag_cadillac;
/* Controls whether compiler generates code to build objects
that can be collected when they become garbage. */
int flag_gc;
/* Controls whether compiler generates 'type descriptor' that give
run-time type information. */
int flag_rtti;
......@@ -404,7 +396,6 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
{"default-inline", &flag_default_inline, 1},
{"dollars-in-identifiers", &dollars_in_ident, 1},
{"enum-int-equiv", &flag_int_enum_equivalence, 1},
{"gc", &flag_gc, 1},
{"rtti", &flag_rtti, 1},
{"xref", &flag_gnu_xref, 1},
{"nonnull-objects", &flag_assume_nonnull_objects, 1},
......@@ -474,30 +465,6 @@ lang_decode_option (p)
flag_save_memoized_contexts = 0;
found = 1;
}
else if (! strncmp (p, "cadillac", 8))
{
flag_cadillac = atoi (p+9);
found = 1;
}
else if (! strncmp (p, "no-cadillac", 11))
{
flag_cadillac = 0;
found = 1;
}
else if (! strcmp (p, "gc"))
{
flag_gc = 1;
/* This must come along for the ride. */
flag_rtti = 1;
found = 1;
}
else if (! strcmp (p, "no-gc"))
{
flag_gc = 0;
/* This must come along for the ride. */
flag_rtti = 0;
found = 1;
}
else if (! strcmp (p, "alt-external-templates"))
{
flag_external_templates = 1;
......@@ -1411,9 +1378,6 @@ grokfield (declarator, declspecs, raises, init, asmspec_tree, attrlist)
return void_type_node;
}
if (flag_cadillac)
cadillac_start_decl (value);
if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree);
......@@ -1955,57 +1919,6 @@ grok_function_init (decl, init)
cp_error ("invalid initializer for virtual method `%D'", decl);
}
/* When we get a declaration of the form
type cname::fname ...
the node for `cname::fname' gets built here in a special way.
Namely, we push into `cname's scope. When this declaration is
processed, we pop back out. */
tree
build_push_scope (cname, name)
tree cname;
tree name;
{
extern int current_class_depth;
tree ctype, rval;
int is_ttp = 0;
if (cname == error_mark_node)
return error_mark_node;
ctype = IDENTIFIER_TYPE_VALUE (cname);
if (TREE_CODE (ctype) == TEMPLATE_TYPE_PARM)
is_ttp = 1;
else if (ctype == NULL_TREE || ! IS_AGGR_TYPE (ctype))
{
cp_error ("`%T' not defined as aggregate type", cname);
return name;
}
else if (IS_SIGNATURE (ctype))
{
error ("cannot push into signature scope, scope resolution operator ignored");
return name;
}
rval = build_parse_node (SCOPE_REF, cname, name);
/* Don't need to push the scope if we're already in it.
We also don't need to push the scope for a ptr-to-member/method. */
if (ctype == current_class_type || TREE_CODE (name) != IDENTIFIER_NODE
|| is_ttp)
return rval;
/* We do need to push the scope in this case, since CTYPE helps
determine subsequent initializers (i.e., Foo::Bar x = foo_enum_1;). */
push_nested_class (ctype, 3);
TREE_COMPLEXITY (rval) = current_class_depth;
return rval;
}
void
cplus_decl_attributes (decl, attributes, prefix_attributes)
tree decl, attributes, prefix_attributes;
......@@ -2189,9 +2102,6 @@ get_temp_regvar (type, init)
expand_decl (decl);
expand_decl_init (decl);
if (type_needs_gc_entry (type))
DECL_GC_OFFSET (decl) = size_int (++current_function_obstack_index);
return decl;
}
......@@ -2287,9 +2197,6 @@ finish_anon_union (anon_union_decl)
/* The following call assumes that there are never any cleanups
for anonymous unions--a reasonable assumption. */
expand_anon_union_decl (anon_union_decl, NULL_TREE, elems);
if (flag_cadillac)
cadillac_finish_anon_union (anon_union_decl);
}
/* Finish and output a table which is generated by the compiler.
......
......@@ -481,12 +481,6 @@ push_eh_entry (stack)
struct ehNode *node = (struct ehNode*)xmalloc (sizeof (struct ehNode));
struct ehEntry *entry = (struct ehEntry*)xmalloc (sizeof (struct ehEntry));
if (stack == NULL) {
free (node);
free (entry);
return NULL_RTX;
}
/* These are saved for the exception table. */
push_rtl_perm ();
entry->start_label = gen_label_rtx ();
......@@ -510,22 +504,20 @@ push_eh_entry (stack)
return entry->start_label;
}
/* Pop an entry from the given STACK. */
static struct ehEntry *
pop_eh_entry (stack)
struct ehStack *stack;
{
struct ehNode *tempnode;
struct ehEntry *tempentry;
tempnode = stack->top;
tempentry = tempnode->entry;
stack->top = stack->top->chain;
free (tempnode);
if (stack && (tempnode = stack->top)) {
tempentry = tempnode->entry;
stack->top = stack->top->chain;
free (tempnode);
return tempentry;
}
return NULL;
return tempentry;
}
static struct ehEntry *
......@@ -742,21 +734,21 @@ init_exception_processing ()
d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_pc"));
d = start_decl (d, declspecs, 0, NULL_TREE);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_pc = lookup_name (get_identifier ("__eh_pc"), 0);
declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE);
d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_type"));
d = start_decl (d, declspecs, 0, NULL_TREE);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_throw_type = lookup_name (get_identifier ("__eh_type"), 0);
declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE);
d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_value"));
d = start_decl (d, declspecs, 0, NULL_TREE);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_throw_value = lookup_name (get_identifier ("__eh_value"), 0);
declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE);
......@@ -764,7 +756,7 @@ init_exception_processing ()
d = build_parse_node (CALL_EXPR, d, void_list_node, NULL_TREE);
d = start_decl (d, declspecs, 0, NULL_TREE);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_cleanup = lookup_name (get_identifier ("__eh_cleanup"), 0);
}
......
......@@ -358,6 +358,7 @@ extract_init (decl, init)
{
return 0;
#if 0
if (IS_AGGR_TYPE (TREE_TYPE (decl))
|| TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
init = extract_aggr_init (decl, init);
......@@ -369,4 +370,5 @@ extract_init (decl, init)
DECL_INITIAL (decl) = init;
return 1;
#endif
}
......@@ -32,8 +32,6 @@ Boston, MA 02111-1307, USA. */
"-fno-alt-external-templates",
"-fansi-overloading",
"-fno-ansi-overloading",
"-fcadillac",
"-fno-cadillac",
"-fcheck-new",
"-fno-check-new",
"-fconserve-space",
......@@ -50,8 +48,6 @@ Boston, MA 02111-1307, USA. */
"-fno-external-templates",
"-ffor-scope",
"-fno-for-scope",
"-fgc",
"-fno-gc",
"-fgnu-keywords",
"-fno-gnu-keywords",
"-fhandle-exceptions",
......
......@@ -360,9 +360,6 @@ lang_init ()
/* With luck, we discover the real source file's name from that
and put it in input_filename. */
put_back (check_newline ());
if (flag_cadillac)
cadillac_start ();
if (flag_gnu_xref) GNU_xref_begin (input_filename);
init_repo (input_filename);
}
......@@ -793,7 +790,7 @@ init_lex ()
}
#endif
if (! (flag_gc || flag_rtti) || flag_no_gnu_keywords)
if (!flag_rtti || flag_no_gnu_keywords)
{
UNSET_RESERVED_WORD ("classof");
UNSET_RESERVED_WORD ("headof");
......@@ -1129,7 +1126,7 @@ do_pending_inlines ()
/* Reverse the pending inline functions, since
they were cons'd instead of appended. */
{
struct pending_inline *prev = 0, *tail, *bottom = 0;
struct pending_inline *prev = 0, *tail;
t = pending_inlines;
pending_inlines = 0;
......@@ -1140,33 +1137,6 @@ do_pending_inlines ()
t->deja_vu = 1;
prev = t;
}
/* This kludge should go away when synthesized methods are handled
properly, i.e. only when needed. */
for (t = prev; t; t = t->next)
{
if (t->lineno <= 0)
{
tree f = t->fndecl;
DECL_PENDING_INLINE_INFO (f) = 0;
interface_unknown = t->interface == 1;
interface_only = t->interface == 0;
synthesize_method (f);
if (tail)
tail->next = t->next;
else
prev = t->next;
if (! bottom)
bottom = t;
}
else
tail = t;
}
if (bottom)
{
obstack_free (&synth_obstack, bottom);
extract_interface_info ();
}
t = prev;
}
......@@ -2491,9 +2461,6 @@ linenum:
body_time = this_time;
}
if (flag_cadillac)
cadillac_note_source ();
input_filename
= (char *) permalloc (TREE_STRING_LENGTH (yylval.ttype) + 1);
strcpy (input_filename, TREE_STRING_POINTER (yylval.ttype));
......@@ -2607,8 +2574,6 @@ linenum:
&& write_symbols == DWARF_DEBUG)
dwarfout_start_new_source_file (input_filename);
#endif /* DWARF_DEBUGGING_INFO */
if (flag_cadillac)
cadillac_push_source ();
in_system_header = entering_system_header;
if (c_header_level)
++c_header_level;
......@@ -2631,8 +2596,6 @@ linenum:
warning ("badly nested C headers from preprocessor");
--pending_lang_change;
}
if (flag_cadillac)
cadillac_pop_source ();
in_system_header = entering_system_header;
p = input_file_stack;
......@@ -2653,11 +2616,7 @@ linenum:
error ("#-lines for entering and leaving files don't match");
}
else
{
in_system_header = entering_system_header;
if (flag_cadillac)
cadillac_switch_source (-1);
}
in_system_header = entering_system_header;
}
/* If NEXTCHAR is not end of line, we don't care what it is. */
......
......@@ -929,21 +929,6 @@ build_static_name (basetype, name)
return get_identifier (buf);
}
/* Generate an identifier that encodes the (ANSI) exception TYPE. */
/* This should be part of `ansi_opname', or at least be defined by the std. */
#define EXCEPTION_NAME_PREFIX "__ex"
#define EXCEPTION_NAME_LENGTH 4
tree
cplus_exception_name (type)
tree type;
{
OB_INIT ();
OB_PUTS (EXCEPTION_NAME_PREFIX);
return get_identifier (build_overload_name (type, 0, 1));
}
/* Change the name of a function definition so that it may be
overloaded. NAME is the name of the function to overload,
PARMS is the parameter list (which determines what name the
......
......@@ -510,7 +510,7 @@ template_def:
d = start_decl ($<ttype>2, /*current_declspecs*/NULL_TREE, 0,
$3);
cplus_decl_attributes (d, $5, /*prefix_attributes*/NULL_TREE);
cp_finish_decl (d, NULL_TREE, $4, 0, 0);
cp_finish_decl (d, NULL_TREE, $4, 1, 0);
end_template_decl ($1, d, 0, def);
if (def)
reinit_parse_for_template ((int) $6, $1, d);
......@@ -527,7 +527,7 @@ template_def:
momentary = suspend_momentary ();
d = start_decl ($<ttype>3, specs, 0, $<ttype>4);
cplus_decl_attributes (d, $6, attrs);
cp_finish_decl (d, NULL_TREE, $5, 0, 0);
cp_finish_decl (d, NULL_TREE, $5, 1, 0);
end_template_decl ($1, d, 0, def);
if (def)
{
......@@ -544,7 +544,7 @@ template_def:
split_specs_attrs ($2, &specs, &attrs);
d = start_decl ($<ttype>3, specs, 0, NULL_TREE);
cplus_decl_attributes (d, NULL_TREE, attrs);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
end_template_decl ($1, d, 0, def);
if (def)
reinit_parse_for_template ((int) $4, $1, d);
......@@ -572,7 +572,7 @@ datadef:
split_specs_attrs ($1, &specs, &attrs);
d = start_decl ($<ttype>2, specs, 0, NULL_TREE);
cplus_decl_attributes (d, NULL_TREE, attrs);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
}
| typed_declspecs initdecls ';'
{
......@@ -584,7 +584,7 @@ datadef:
split_specs_attrs ($1, &specs, &attrs);
d = start_decl ($<ttype>2, specs, 0, NULL_TREE);
cplus_decl_attributes (d, NULL_TREE, attrs);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
note_list_got_semicolon ($<ttype>$);
}
| declmods ';'
......@@ -996,7 +996,7 @@ condition:
}
init
{
cp_finish_decl ($<ttype>7, $8, $5, 0, LOOKUP_ONLYCONVERTING);
cp_finish_decl ($<ttype>7, $8, $5, 1, LOOKUP_ONLYCONVERTING);
resume_momentary ($<itype>6);
$$ = $<ttype>7;
if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE)
......@@ -1729,7 +1729,7 @@ decl:
{ tree d = get_decl_list ($1);
int yes = suspend_momentary ();
d = start_decl ($2, d, 0, NULL_TREE);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
resume_momentary (yes);
if (IS_AGGR_TYPE_CODE (TREE_CODE ($1)))
note_got_semicolon ($1);
......@@ -1741,7 +1741,7 @@ decl:
yes = suspend_momentary ();
d = start_decl ($2, specs, 0, NULL_TREE);
cplus_decl_attributes (d, NULL_TREE, attrs);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
resume_momentary (yes);
note_list_got_semicolon ($1);
}
......@@ -1985,7 +1985,7 @@ initdcl0:
cplus_decl_attributes ($<ttype>$, $4, prefix_attributes); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
{ cp_finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING);
{ cp_finish_decl ($<ttype>6, $7, $3, 1, LOOKUP_ONLYCONVERTING);
$$ = $<itype>5; }
| declarator exception_specification_opt maybeasm maybe_attribute
{ tree d;
......@@ -2003,7 +2003,7 @@ initdcl0:
$$ = suspend_momentary ();
d = start_decl ($<ttype>1, current_declspecs, 0, $2);
cplus_decl_attributes (d, $4, prefix_attributes);
cp_finish_decl (d, NULL_TREE, $3, 0, 0); }
cp_finish_decl (d, NULL_TREE, $3, 1, 0); }
;
initdcl:
......@@ -2012,11 +2012,11 @@ initdcl:
cplus_decl_attributes ($<ttype>$, $4, prefix_attributes); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
{ cp_finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING); }
{ cp_finish_decl ($<ttype>6, $7, $3, 1, LOOKUP_ONLYCONVERTING); }
| declarator exception_specification_opt maybeasm maybe_attribute
{ $<ttype>$ = start_decl ($<ttype>1, current_declspecs, 0, $2);
cplus_decl_attributes ($<ttype>$, $4, prefix_attributes);
cp_finish_decl ($<ttype>$, NULL_TREE, $3, 0, 0); }
cp_finish_decl ($<ttype>$, NULL_TREE, $3, 1, 0); }
;
notype_initdcl0:
......@@ -2028,7 +2028,7 @@ notype_initdcl0:
cplus_decl_attributes ($<ttype>$, $4, prefix_attributes); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
{ cp_finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING);
{ cp_finish_decl ($<ttype>6, $7, $3, 1, LOOKUP_ONLYCONVERTING);
$$ = $<itype>5; }
| notype_declarator exception_specification_opt maybeasm maybe_attribute
{ tree d;
......@@ -2037,7 +2037,7 @@ notype_initdcl0:
$$ = suspend_momentary ();
d = start_decl ($<ttype>1, current_declspecs, 0, $2);
cplus_decl_attributes (d, $4, prefix_attributes);
cp_finish_decl (d, NULL_TREE, $3, 0, 0); }
cp_finish_decl (d, NULL_TREE, $3, 1, 0); }
;
nomods_initdcl0:
......@@ -2049,7 +2049,7 @@ nomods_initdcl0:
cplus_decl_attributes ($<ttype>$, $4, prefix_attributes); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
{ cp_finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING);
{ cp_finish_decl ($<ttype>6, $7, $3, 1, LOOKUP_ONLYCONVERTING);
$$ = $<itype>5; }
| notype_declarator exception_specification_opt maybeasm maybe_attribute
{ tree d;
......@@ -2058,7 +2058,7 @@ nomods_initdcl0:
$$ = suspend_momentary ();
d = start_decl ($1, current_declspecs, 0, $2);
cplus_decl_attributes (d, $4, prefix_attributes);
cp_finish_decl (d, NULL_TREE, $3, 0, 0); }
cp_finish_decl (d, NULL_TREE, $3, 1, 0); }
;
/* the * rules are dummies to accept the Apollo extended syntax
......
......@@ -440,34 +440,6 @@ convert_pointer_to_vbase (type, expr)
return convert_pointer_to_real (vb, expr);
}
/* This is the newer recursive depth first search routine. */
#if 0 /* unused */
/* Return non-zero if PARENT is directly derived from TYPE. By directly
we mean it's only one step up the inheritance lattice. We check this
by walking horizontally across the types that TYPE directly inherits
from, to see if PARENT is among them. This is used by get_binfo and
by compute_access. */
static int
immediately_derived (parent, type)
tree parent, type;
{
if (TYPE_BINFO (type))
{
tree binfos = BINFO_BASETYPES (TYPE_BINFO (type));
int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
for (i = 0; i < n_baselinks; i++)
{
tree base_binfo = TREE_VEC_ELT (binfos, i);
if (parent == BINFO_TYPE (base_binfo))
return 1;
}
}
return 0;
}
#endif
/* Check whether the type given in BINFO is derived from PARENT. If
it isn't, return 0. If it is, but the derivation is MI-ambiguous
AND protect != 0, emit an error message and return error_mark_node.
......@@ -1320,7 +1292,7 @@ lookup_field (xbasetype, name, protect, want_type)
{
/* This is ambiguous. */
errstr = "request for member `%D' is ambiguous";
protect = 2;
protect += 2;
break;
}
}
......@@ -1426,6 +1398,14 @@ lookup_field (xbasetype, name, protect, want_type)
}
}
if (protect == 2)
{
/* If we are not interested in ambiguities, don't report them,
just return NULL_TREE. */
rval = NULL_TREE;
protect = 0;
}
if (errstr && protect)
{
cp_error (errstr, name, type);
......@@ -1911,16 +1891,6 @@ breadth_first_search (binfo, testfn, qfn)
typedef tree (*pft)();
typedef int (*pfi)();
int tree_needs_constructor_p (binfo, i)
tree binfo;
int i;
{
tree basetype;
my_friendly_assert (i != 0, 296);
basetype = BINFO_TYPE (BINFO_BASETYPE (binfo, i));
return TYPE_NEEDS_CONSTRUCTING (basetype);
}
static tree declarator;
static tree
......@@ -2098,8 +2068,6 @@ get_matching_virtual (binfo, fndecl, dtorp)
break;
}
}
if (best == NULL_TREE && warn_overloaded_virtual)
cp_warning_at ("conflicting specification deriving virtual function `%D'", fndecl);
return best;
}
......@@ -2836,65 +2804,28 @@ fixup_virtual_upcast_offsets (real_binfo, binfo, init_self, can_elide, addr, ori
ICK! */
void
expand_indirect_vtbls_init (binfo, true_exp, decl_ptr, use_computed_offsets)
expand_indirect_vtbls_init (binfo, true_exp, decl_ptr)
tree binfo;
tree true_exp, decl_ptr;
int use_computed_offsets;
{
tree type = BINFO_TYPE (binfo);
if (TYPE_USES_VIRTUAL_BASECLASSES (type))
{
rtx fixup_insns = NULL_RTX;
int old_flag = flag_this_is_variable;
tree vbases = CLASSTYPE_VBASECLASSES (type);
vbase_types = vbases;
vbase_decl_ptr = true_exp ? build_unary_op (ADDR_EXPR, true_exp, 0) : decl_ptr;
vbase_decl = true_exp ? true_exp : build_indirect_ref (decl_ptr, NULL_PTR);
if (use_computed_offsets)
{
/* This is an object of type IN_TYPE, */
flag_this_is_variable = -2;
}
dfs_walk (binfo, dfs_find_vbases, unmarked_new_vtablep);
/* Initialized with vtables of type TYPE. */
for (; vbases; vbases = TREE_CHAIN (vbases))
{
tree addr;
if (use_computed_offsets)
addr = (tree)CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (vbases));
else
{
#if 1
addr = convert_pointer_to_vbase (TREE_TYPE (vbases), vbase_decl_ptr);
#else
/* This should should never work better than the above. (mrs) */
tree vbinfo = get_binfo (TREE_TYPE (vbases),
TREE_TYPE (vbase_decl),
0);
/* See is we can get lucky. */
if (TREE_VIA_VIRTUAL (vbinfo))
addr = convert_pointer_to_real (vbinfo, vbase_decl_ptr);
else
{
/* We go through all these contortions to avoid this
call, as it will fail when the virtual base type
is ambiguous from here. We don't yet have a way
to search for and find just an instance of the
virtual base class. Searching for the binfo in
vbases won't work, as we don't have the vbase
pointer field, for all vbases in the main class,
only direct vbases. */
addr = convert_pointer_to_real (TREE_TYPE (vbases),
vbase_decl_ptr);
if (addr == error_mark_node)
continue;
}
#endif
}
addr = convert_pointer_to_vbase (TREE_TYPE (vbases), vbase_decl_ptr);
/* Do all vtables from this virtual base. */
/* This assumes that virtual bases can never serve as parent
......@@ -2902,10 +2833,6 @@ expand_indirect_vtbls_init (binfo, true_exp, decl_ptr, use_computed_offsets)
expand_direct_vtbls_init (vbases, TYPE_BINFO (BINFO_TYPE (vbases)),
1, 0, addr);
/* If we are using computed offsets we can skip fixups. */
if (use_computed_offsets)
continue;
/* Now we adjust the offsets for virtual functions that cross
virtual boundaries on an implicit upcast on vf call so that
the layout of the most complete type is used, instead of
......@@ -2944,19 +2871,9 @@ expand_indirect_vtbls_init (binfo, true_exp, decl_ptr, use_computed_offsets)
}
dfs_walk (binfo, dfs_clear_vbase_slots, marked_new_vtablep);
flag_this_is_variable = old_flag;
}
}
void
clear_search_slots (type)
tree type;
{
dfs_walk (TYPE_BINFO (type),
dfs_clear_search_slot, dfs_search_slot_nonempty_p);
}
/* get virtual base class types.
This adds type to the vbase_types list in reverse dfs order.
Ordering is very important, so don't change it. */
......@@ -3359,15 +3276,6 @@ push_class_decls (type)
search_stack = push_search_level (search_stack, &search_obstack);
id = TYPE_IDENTIFIER (type);
#if 0
if (IDENTIFIER_TEMPLATE (id) != 0)
{
tree tmpl = IDENTIFIER_TEMPLATE (id);
push_template_decls (DECL_ARGUMENTS (TREE_PURPOSE (tmpl)),
TREE_VALUE (tmpl), 1);
overload_template_name (id, 1);
}
#endif
/* Push class fields into CLASS_VALUE scope, and mark. */
dfs_walk (TYPE_BINFO (type), dfs_pushdecls, unmarkedp);
......
......@@ -182,36 +182,6 @@ scan_tokens (n)
}
}
/* Create room for N tokens at the front of the fifo. This is used
to insert new tokens into the stream ahead of the current token. */
static void
shift_tokens (n)
int n;
{
if (first_token >= n)
first_token -= n;
else
{
int old_token_count = num_tokens ();
char *tmp;
obstack_blank (&token_obstack, (n-first_token) * sizeof (struct token));
if (old_token_count)
{
tmp = (char *)alloca ((num_tokens () + (n-first_token))
* sizeof (struct token));
/* This move does not rely on the system being able to handle
overlapping moves. */
bcopy ((char *) nth_token (0), tmp,
old_token_count * sizeof (struct token));
bcopy (tmp, (char *) nth_token (n),
old_token_count * sizeof (struct token));
}
first_token = 0;
}
}
static int
probe_obstack (h, obj, nlevels)
struct obstack *h;
......@@ -360,10 +330,12 @@ yylex()
break;
case SCSPEC:
/* do_aggr needs to check if the previous token was RID_FRIEND,
so just increment first_token instead of calling consume_token. */
first_token++;
case NEW:
/* do_aggr needs to check if the previous token was RID_NEW,
so just increment first_token instead of calling consume_token. */
++first_token;
break;
case TYPESPEC:
consume_token ();
break;
......@@ -394,7 +366,7 @@ yylex()
* Thus, token[1] is either a TYPENAME or a TYPENAME_DEFN.
* If token[2] == '{' or ':' then it's TYPENAME_DEFN.
* It's also a definition if it's a forward declaration (as in 'struct Foo;')
* which we can tell lf token[2] == ';' *and* token[-1] != FRIEND.
* which we can tell if token[2] == ';' *and* token[-1] != FRIEND or NEW.
*/
static int
do_aggr ()
......@@ -408,10 +380,16 @@ do_aggr ()
yc2 = nth_token (2)->yychar;
if (yc2 == ';')
{
/* It's a forward declaration iff we were not preceded by 'friend'. */
if (first_token > 0 && nth_token (-1)->yychar == SCSPEC
&& nth_token (-1)->yylval.ttype == ridpointers[(int) RID_FRIEND])
return 0;
/* It's a forward declaration iff we were not preceded by
'friend' or `new'. */
if (first_token > 0)
{
if (nth_token (-1)->yychar == SCSPEC
&& nth_token (-1)->yylval.ttype == ridpointers[(int) RID_FRIEND])
return 0;
if (nth_token (-1)->yychar == NEW)
return 0;
}
}
else if (yc2 != '{' && yc2 != ':')
return 0;
......
......@@ -419,32 +419,6 @@ build_cplus_method_type (basetype, rettype, argtypes)
}
tree
build_cplus_staticfn_type (basetype, rettype, argtypes)
tree basetype, rettype, argtypes;
{
register tree t;
int hashcode;
/* Make a node of the sort we want. */
t = make_node (FUNCTION_TYPE);
TYPE_METHOD_BASETYPE (t) = TYPE_MAIN_VARIANT (basetype);
TREE_TYPE (t) = rettype;
TYPE_ARG_TYPES (t) = argtypes;
/* If we already have such a type, use the old one and free this one.
Note that it also frees up the above cons cell if found. */
hashcode = TYPE_HASH (basetype) + TYPE_HASH (rettype) + type_hash_list (argtypes);
t = type_hash_canon (hashcode, t);
if (TYPE_SIZE (t) == 0)
layout_type (t);
return t;
}
tree
build_cplus_array_type (elt_type, index_type)
tree elt_type;
tree index_type;
......@@ -1149,59 +1123,6 @@ get_decl_list (value)
return build_decl_list (NULL_TREE, value);
}
/* Look in the type hash table for a type isomorphic to
`build_tree_list (NULL_TREE, VALUE)'.
If one is found, return it. Otherwise return 0. */
tree
list_hash_lookup_or_cons (value)
tree value;
{
register int hashcode = TYPE_HASH (value);
register struct list_hash *h;
struct obstack *ambient_obstack;
tree list = NULL_TREE;
if (TREE_CODE (value) == IDENTIFIER_NODE)
list = get_identifier_list (value);
else if (TREE_CODE (value) == TYPE_DECL
&& TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE
&& TYPE_LANG_SPECIFIC (TREE_TYPE (value)))
list = CLASSTYPE_ID_AS_LIST (TREE_TYPE (value));
else if (TREE_CODE (value) == RECORD_TYPE
&& TYPE_LANG_SPECIFIC (value))
list = CLASSTYPE_AS_LIST (value);
if (list != NULL_TREE)
{
my_friendly_assert (TREE_CHAIN (list) == NULL_TREE, 302);
return list;
}
if (debug_no_list_hash)
return hash_tree_chain (value, NULL_TREE);
for (h = list_hash_table[hashcode % TYPE_HASH_SIZE]; h; h = h->next)
if (h->hashcode == hashcode
&& TREE_VIA_VIRTUAL (h->list) == 0
&& TREE_VIA_PUBLIC (h->list) == 0
&& TREE_VIA_PROTECTED (h->list) == 0
&& TREE_PURPOSE (h->list) == 0
&& TREE_VALUE (h->list) == value)
{
my_friendly_assert (TREE_TYPE (h->list) == 0, 303);
my_friendly_assert (TREE_CHAIN (h->list) == 0, 304);
return h->list;
}
ambient_obstack = current_obstack;
current_obstack = &class_obstack;
list = build_tree_list (NULL_TREE, value);
list_hash_add (hashcode, list);
current_obstack = ambient_obstack;
return list;
}
/* Build an association between TYPE and some parameters:
......@@ -1283,38 +1204,6 @@ reverse_path (path)
return prev;
}
tree
virtual_member (elem, list)
tree elem;
tree list;
{
tree t;
tree rval, nval;
for (t = list; t; t = TREE_CHAIN (t))
if (elem == BINFO_TYPE (t))
return t;
rval = 0;
for (t = list; t; t = TREE_CHAIN (t))
{
tree binfos = BINFO_BASETYPES (t);
int i;
if (binfos != NULL_TREE)
for (i = TREE_VEC_LENGTH (binfos)-1; i >= 0; i--)
{
nval = binfo_value (elem, BINFO_TYPE (TREE_VEC_ELT (binfos, i)));
if (nval)
{
if (rval && BINFO_OFFSET (nval) != BINFO_OFFSET (rval))
my_friendly_abort (104);
rval = nval;
}
}
}
return rval;
}
void
debug_binfo (elem)
tree elem;
......@@ -1379,20 +1268,6 @@ count_functions (t)
return 0;
}
/* Like value_member, but for DECL_CHAINs. */
tree
decl_value_member (elem, list)
tree elem, list;
{
while (list)
{
if (elem == list)
return list;
list = DECL_CHAIN (list);
}
return NULL_TREE;
}
int
is_overloaded_fn (x)
tree x;
......@@ -1450,16 +1325,6 @@ fnaddr_from_vtable_entry (entry)
return TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (entry))));
}
void
set_fnaddr_from_vtable_entry (entry, value)
tree entry, value;
{
if (flag_vtable_thunks)
abort ();
else
TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (entry)))) = value;
}
tree
function_arg_chain (t)
tree t;
......@@ -1555,16 +1420,6 @@ lang_printable_name (decl)
return print_ring[ring_counter];
}
/* Comparison function for sorting identifiers in RAISES lists.
Note that because IDENTIFIER_NODEs are unique, we can sort
them by address, saving an indirection. */
static int
id_cmp (p1, p2)
tree *p1, *p2;
{
return (HOST_WIDE_INT)TREE_VALUE (*p1) - (HOST_WIDE_INT)TREE_VALUE (*p2);
}
/* Build the FUNCTION_TYPE or METHOD_TYPE which may throw exceptions
listed in RAISES. */
tree
......
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