+2003-12-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cvt.c: Remove uses of "register" specifier in
+ declarations of arguments and local variables.
+ * decl.c: Likewise.
+ * decl2.c: Likewise.
+ * expr.c: Likewise.
+ * friend.c: Likewise.
+ * lex.c: Likewise.
+ * name-lookup.c: Likewise.
+ * repo.c: Likewise.
+ * search.c: Likewise.
+ * tree.c: Likewise.
+ * typeck.c: Likewise.
+ * typeck2.c: Likewise.
+
2003-12-19 Mark Mitchell <mark@codesourcery.com>
PR c++/12795
static tree
cp_convert_to_pointer (tree type, tree expr, bool force)
{
- register tree intype = TREE_TYPE (expr);
- register enum tree_code form;
+ tree intype = TREE_TYPE (expr);
+ enum tree_code form;
tree rval;
if (IS_AGGR_TYPE (intype))
static tree
convert_to_pointer_force (tree type, tree expr)
{
- register tree intype = TREE_TYPE (expr);
- register enum tree_code form = TREE_CODE (intype);
+ tree intype = TREE_TYPE (expr);
+ enum tree_code form = TREE_CODE (intype);
if (form == POINTER_TYPE)
{
convert_to_reference (tree reftype, tree expr, int convtype,
int flags, tree decl)
{
- register tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype));
- register tree intype;
+ tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype));
+ tree intype;
tree rval = NULL_TREE;
tree rval_as_conversion = NULL_TREE;
bool can_convert_intype_to_type;
tree
ocp_convert (tree type, tree expr, int convtype, int flags)
{
- register tree e = expr;
- register enum tree_code code = TREE_CODE (type);
+ tree e = expr;
+ enum tree_code code = TREE_CODE (type);
if (error_operand_p (e) || type == error_mark_node)
return error_mark_node;
tree
convert_force (tree type, tree expr, int convtype)
{
- register tree e = expr;
- register enum tree_code code = TREE_CODE (type);
+ tree e = expr;
+ enum tree_code code = TREE_CODE (type);
if (code == REFERENCE_TYPE)
return fold (convert_to_reference (type, e, CONV_C_CAST, LOOKUP_COMPLAIN,
tree
poplevel (int keep, int reverse, int functionbody)
{
- register tree link;
+ tree link;
/* The chain of decls was accumulated in reverse order.
Put it into forward order, just for cleanliness. */
tree decls;
/* Deal with C++: must preserve virtual function table size. */
if (TREE_CODE (olddecl) == TYPE_DECL)
{
- register tree newtype = TREE_TYPE (newdecl);
- register tree oldtype = TREE_TYPE (olddecl);
+ tree newtype = TREE_TYPE (newdecl);
+ tree oldtype = TREE_TYPE (olddecl);
if (newtype != error_mark_node && oldtype != error_mark_node
&& TYPE_LANG_SPECIFIC (newtype) && TYPE_LANG_SPECIFIC (oldtype))
tree
implicitly_declare (tree functionid)
{
- register tree decl;
+ tree decl;
/* We used to reuse an old implicit decl here,
but this loses with inline functions because it can clobber
{
tree decl = lookup_label (name);
struct named_label_list *ent;
- register struct cp_binding_level *p;
+ struct cp_binding_level *p;
timevar_push (TV_NAME_LOOKUP);
for (ent = named_labels; ent; ent = ent->next)
finish_case_label (tree low_value, tree high_value)
{
tree cond, r;
- register struct cp_binding_level *p;
+ struct cp_binding_level *p;
if (processing_template_decl)
{
int saw_friend = 0;
int saw_typedef = 0;
tree ob_modifier = NULL_TREE;
- register tree link;
+ tree link;
/* If a class, struct, or enum type is declared by the DECLSPECS
(i.e, if a class-specifier, enum-specifier, or non-typename
elaborated-type-specifier appears in the DECLSPECS),
tree prefix_attributes)
{
tree decl;
- register tree type, tem;
+ tree type, tem;
tree context;
/* This should only be done once on the top most decl. */
int
complete_array_type (tree type, tree initial_value, int do_default)
{
- register tree maxindex = NULL_TREE;
+ tree maxindex = NULL_TREE;
int value = 0;
if (initial_value)
and get it as a string, for an error message. */
{
tree *next = &declarator;
- register tree decl;
+ tree decl;
name = NULL;
while (next && *next)
for (spec = declspecs; spec; spec = TREE_CHAIN (spec))
{
- register int i;
- register tree id;
+ int i;
+ tree id;
/* Certain parse errors slip through. For example,
`int class;' is not caught by the parser. Try
error ("two or more data types in declaration of `%s'", name);
else if (TREE_CODE (id) == IDENTIFIER_NODE)
{
- register tree t = lookup_name (id, 1);
+ tree t = lookup_name (id, 1);
if (!t || TREE_CODE (t) != TYPE_DECL)
error ("`%s' fails to be a typedef or built in type",
IDENTIFIER_POINTER (id));
if (decl_context == FIELD)
{
tree tmp = NULL_TREE;
- register int op = 0;
+ int op = 0;
if (declarator)
{
if (TREE_TYPE (declarator))
{
- register tree typemodlist;
+ tree typemodlist;
int erred = 0;
int constp = 0;
int volatilep = 0;
}
{
- register tree decl;
+ tree decl;
if (decl_context == PARM)
{
bool globalize, bool template_header_p)
{
enum tree_code code;
- register tree t;
+ tree t;
struct cp_binding_level *b = current_binding_level;
tree context = NULL_TREE;
tree
start_enum (tree name)
{
- register tree enumtype = NULL_TREE;
+ tree enumtype = NULL_TREE;
struct cp_binding_level *b = current_binding_level;
/* If this is the real definition for a previous forward reference,
static void
store_parm_decls (tree current_function_parms)
{
- register tree fndecl = current_function_decl;
- register tree parm;
+ tree fndecl = current_function_decl;
+ tree parm;
/* This is a chain of any other decls that came in among the parm
declarations. If a parm is declared with enum {foo, bar} x;
tree
finish_function (int flags)
{
- register tree fndecl = current_function_decl;
+ tree fndecl = current_function_decl;
tree fntype, ctype = NULL_TREE;
int inclass_inline = (flags & 2) != 0;
int nested;
tree
finish_method (tree decl)
{
- register tree fndecl = decl;
+ tree fndecl = decl;
tree old_initial;
- register tree link;
+ tree link;
if (decl == void_type_node)
return decl;
tree
grokbitfield (tree declarator, tree declspecs, tree width)
{
- register tree value = grokdeclarator (declarator, declspecs, BITFIELD,
- 0, NULL);
+ tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL);
if (! value) return NULL_TREE; /* friends went bad. */
cxx_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
{
tree type = TREE_TYPE (exp);
- register enum machine_mode mode = TYPE_MODE (type);
- register enum tree_code code = TREE_CODE (exp);
+ enum machine_mode mode = TYPE_MODE (type);
+ enum tree_code code = TREE_CODE (exp);
rtx ret;
/* No sense saving up arithmetic to be done
is_friend (tree type, tree supplicant)
{
int declp;
- register tree list;
+ tree list;
tree context;
if (supplicant == NULL_TREE || type == NULL_TREE)
tree
cxx_make_type (enum tree_code code)
{
- register tree t = make_node (code);
+ tree t = make_node (code);
/* Create lang_type structure. */
if (IS_AGGR_TYPE_CODE (code)
tree
pushdecl (tree x)
{
- register tree t;
- register tree name;
+ tree t;
+ tree name;
int need_new_binding;
timevar_push (TV_NAME_LOOKUP);
void
clear_anon_tags (void)
{
- register struct cp_binding_level *b;
+ struct cp_binding_level *b;
static int last_cnt = 0;
/* Fast out if no new anon names were declared. */
tree
pushdecl_with_scope (tree x, cxx_scope *level)
{
- register struct cp_binding_level *b;
+ struct cp_binding_level *b;
tree function_decl = current_function_decl;
timevar_push (TV_NAME_LOOKUP);
lookup_tag (enum tree_code form, tree name,
cxx_scope *binding_level, int thislevel_only)
{
- register struct cp_binding_level *level;
+ struct cp_binding_level *level;
/* Nonzero if, we should look past a template parameter level, even
if THISLEVEL_ONLY. */
int allow_template_parms_p = 1;
timevar_push (TV_NAME_LOOKUP);
for (level = binding_level; level; level = level->level_chain)
{
- register tree tail;
+ tree tail;
if (type_is_anonymous && level->type_decls != NULL)
{
tree type = binding_table_find_anon_type (level->type_decls, name);
tree
lookup_tag_reverse (tree type, tree name)
{
- register struct cp_binding_level *level;
+ struct cp_binding_level *level;
timevar_push (TV_NAME_LOOKUP);
for (level = current_binding_level; level; level = level->level_chain)
void
poplevel_class (void)
{
- register struct cp_binding_level *level = class_binding_level;
+ struct cp_binding_level *level = class_binding_level;
tree shadowed;
timevar_push (TV_NAME_LOOKUP);
tree
pushdecl_namespace_level (tree x)
{
- register struct cp_binding_level *b = current_binding_level;
- register tree t;
+ struct cp_binding_level *b = current_binding_level;
+ tree t;
timevar_push (TV_NAME_LOOKUP);
t = pushdecl_with_scope (x, NAMESPACE_LEVEL (current_namespace));
static tree
lookup_type_current_level (tree name)
{
- register tree t = NULL_TREE;
+ tree t = NULL_TREE;
timevar_push (TV_NAME_LOOKUP);
my_friendly_assert (current_binding_level->kind != sk_namespace,
void
pushtag (tree name, tree type, int globalize)
{
- register struct cp_binding_level *b;
+ struct cp_binding_level *b;
timevar_push (TV_NAME_LOOKUP);
b = current_binding_level;
/* Do C++ gratuitous typedefing. */
if (IDENTIFIER_TYPE_VALUE (name) != type)
{
- register tree d = NULL_TREE;
+ tree d = NULL_TREE;
int in_class = 0;
tree context = TYPE_CONTEXT (type);
static void
open_repo_file (const char *filename)
{
- register const char *p;
+ const char *p;
const char *s = get_base_filename (filename);
if (s == NULL)
static struct search_level *
pop_search_level (struct stack_level *obstack)
{
- register struct search_level *stack = pop_stack_level (obstack);
+ struct search_level *stack = pop_stack_level (obstack);
return stack;
}
tree
lookup_field_1 (tree type, tree name, bool want_type)
{
- register tree field;
+ tree field;
if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
|| TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM
tree
build_min_nt (enum tree_code code, ...)
{
- register tree t;
- register int length;
- register int i;
+ tree t;
+ int length;
+ int i;
va_list p;
va_start (p, code);
tree
build_min (enum tree_code code, tree tt, ...)
{
- register tree t;
- register int length;
- register int i;
+ tree t;
+ int length;
+ int i;
va_list p;
va_start (p, tt);
tree
build_min_non_dep (enum tree_code code, tree non_dep, ...)
{
- register tree t;
- register int length;
- register int i;
+ tree t;
+ int length;
+ int i;
va_list p;
va_start (p, non_dep);
bool
cp_tree_equal (tree t1, tree t2)
{
- register enum tree_code code1, code2;
+ enum tree_code code1, code2;
if (t1 == t2)
return true;
tree
merge_types (tree t1, tree t2)
{
- register enum tree_code code1;
- register enum tree_code code2;
+ enum tree_code code1;
+ enum tree_code code2;
tree attributes;
/* Save time if the two types are the same. */
tree
decay_conversion (tree exp)
{
- register tree type;
- register enum tree_code code;
+ tree type;
+ enum tree_code code;
type = TREE_TYPE (exp);
code = TREE_CODE (type);
return build_unary_op (ADDR_EXPR, exp, 0);
if (code == ARRAY_TYPE)
{
- register tree adr;
+ tree adr;
tree ptrtype;
if (TREE_CODE (exp) == INDIRECT_REF)
tree
build_indirect_ref (tree ptr, const char *errorstring)
{
- register tree pointer, type;
+ tree pointer, type;
if (ptr == error_mark_node)
return error_mark_node;
tree
build_function_call (tree function, tree params)
{
- register tree fntype, fndecl;
- register tree coerced_params;
+ tree fntype, fndecl;
+ tree coerced_params;
tree result;
tree name = NULL_TREE, assembler_name = NULL_TREE;
int is_method;
tree
convert_arguments (tree typelist, tree values, tree fndecl, int flags)
{
- register tree typetail, valtail;
- register tree result = NULL_TREE;
+ tree typetail, valtail;
+ tree result = NULL_TREE;
const char *called_thing = 0;
int i = 0;
valtail;
valtail = TREE_CHAIN (valtail), i++)
{
- register tree type = typetail ? TREE_VALUE (typetail) : 0;
- register tree val = TREE_VALUE (valtail);
+ tree type = typetail ? TREE_VALUE (typetail) : 0;
+ tree val = TREE_VALUE (valtail);
if (val == error_mark_node)
return error_mark_node;
int convert_p ATTRIBUTE_UNUSED)
{
tree op0, op1;
- register enum tree_code code0, code1;
+ enum tree_code code0, code1;
tree type0, type1;
/* Expression code to give to the expression when it is built.
Normally this is CODE, which is what the caller asked for,
but in some special cases we change it. */
- register enum tree_code resultcode = code;
+ enum tree_code resultcode = code;
/* Data type in which the computation is to be performed.
In the simplest cases this is the common type of the arguments. */
- register tree result_type = NULL;
+ tree result_type = NULL;
/* Nonzero means operands have already been type-converted
in whatever way is necessary.
build_type = result_type;
{
- register tree result = build (resultcode, build_type, op0, op1);
- register tree folded;
+ tree result = build (resultcode, build_type, op0, op1);
+ tree folded;
folded = fold (result);
if (folded == result)
of pointer PTROP and integer INTOP. */
static tree
-cp_pointer_int_sum (enum tree_code resultcode, register tree ptrop,
- register tree intop)
+cp_pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
{
tree res_type = TREE_TYPE (ptrop);
The resulting tree has type int. */
static tree
-pointer_diff (register tree op0, register tree op1, register tree ptrtype)
+pointer_diff (tree op0, tree op1, tree ptrtype)
{
- register tree result, folded;
+ tree result, folded;
tree restype = ptrdiff_type_node;
tree target_type = TREE_TYPE (ptrtype);
build_unary_op (enum tree_code code, tree xarg, int noconvert)
{
/* No default_conversion here. It causes trouble for ADDR_EXPR. */
- register tree arg = xarg;
- register tree argtype = 0;
+ tree arg = xarg;
+ tree argtype = 0;
const char *errstring = NULL;
tree val;
0);
{
- register tree inc;
+ tree inc;
tree result_type = TREE_TYPE (arg);
arg = get_unwidened (arg, 0);
bool
cxx_mark_addressable (tree exp)
{
- register tree x = exp;
+ tree x = exp;
while (1)
switch (TREE_CODE (x))
tree
build_c_cast (tree type, tree expr)
{
- register tree value = expr;
+ tree value = expr;
tree otype;
if (type == error_mark_node || expr == error_mark_node)
tree
build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
{
- register tree result;
+ tree result;
tree newrhs = rhs;
tree lhstype = TREE_TYPE (lhs);
tree olhstype = lhstype;
convert_for_assignment (tree type, tree rhs,
const char *errtype, tree fndecl, int parmnum)
{
- register tree rhstype;
- register enum tree_code coder;
+ tree rhstype;
+ enum tree_code coder;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
if (TREE_CODE (rhs) == NON_LVALUE_EXPR)
convert_for_initialization (tree exp, tree type, tree rhs, int flags,
const char *errtype, tree fndecl, int parmnum)
{
- register enum tree_code codel = TREE_CODE (type);
- register tree rhstype;
- register enum tree_code coder;
+ enum tree_code codel = TREE_CODE (type);
+ tree rhstype;
+ enum tree_code coder;
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
Strip such NOP_EXPRs, since RHS is used in non-lvalue context. */
int vol, location_t locus)
{
int noutputs = list_length (outputs);
- register int i;
+ int i;
/* o[I] is the place that output number I should be written. */
- register tree *o = alloca (noutputs * sizeof (tree));
- register tree tail;
+ tree *o = alloca (noutputs * sizeof (tree));
+ tree tail;
/* Record the contents of OUTPUTS before it is modified. */
for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
tree
store_init_value (tree decl, tree init)
{
- register tree value, type;
+ tree value, type;
/* If variable's type was invalidly declared, just ignore it. */
if (TYPE_DOMAIN (type) != 0
&& TREE_CONSTANT (TYPE_SIZE (type)))
{
- register int size
- = TREE_INT_CST_LOW (TYPE_SIZE (type));
+ int size = TREE_INT_CST_LOW (TYPE_SIZE (type));
size = (size + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
/* In C it is ok to subtract 1 from the length of the string
because it's ok to ignore the terminating null char that is
static tree
process_init_constructor (tree type, tree init, tree* elts)
{
- register tree tail;
+ tree tail;
/* List of the elements of the result constructor,
in reverse order. */
- register tree members = NULL;
- register tree next1;
+ tree members = NULL;
+ tree next1;
tree result;
int allconstant = 1;
int allsimple = 1;
if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == VECTOR_TYPE)
{
- register long len;
- register int i;
+ long len;
+ int i;
if (TREE_CODE (type) == ARRAY_TYPE)
{
}
else if (TREE_CODE (type) == RECORD_TYPE)
{
- register tree field;
+ tree field;
if (tail)
{
/* If the initializer was empty, use default zero initialization. */
&& tail)
{
- register tree field = TYPE_FIELDS (type);
+ tree field = TYPE_FIELDS (type);
/* Find the first named field. ANSI decided in September 1990
that only named fields count here. */