Commit 83bab8db by Mark Mitchell Committed by Mark Mitchell

Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o.

	* Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o.
	(c-iterate.o): Remove target.
	* gcc/c-common.h (enum rid): Remove RID_ITERATOR.
	* gcc/c-decl.c (init_decl_processing): Remove call to init_iterators.
	(finish_decl): Don't handle iterators.
	(grokdeclarator): Likewise.
	* gcc/c-parse.gperf: Remove __iterator and __iterator__ keywords.
	* gcc/c-gperf.h: Regenerated.
	* gcc/c-iterate.c: Removed.
	* gcc/c-lex.c (init_lex): Don't handle iterators.
	* gcc/c-parse.in (primary): Remove pop_iterator_stack call.
	(compstmt_primary_start): Remove push_iterator_stack call.
	(stmt): Don't allow iterator statements.  Replace iterator_expand
	with expand_expr_stmt.
	(all_iter_stmt): Remove.
	(all_iter_stmt_simple): Likewise.
	(all_iter_stmt_with_decl): Likewise.
	* gcc/c-tree.h (ITERATOR_P): Remove.
	(ITERATOR_BOUND_P): Likewise.
	(init_iterators): Remove declaration.
	(iterator_expand): Likewise.
	(iterator_for_loop_start): Likewise.
	(iterator_for_loop_end): Likewise.
	(iterator_for_loop_record): Likewise.
	(push_iterator_stack): Likewise.
	(pop_iterator_stack): Likewise.
	* gcc/c-typeck.c (decl_constant_value): Don't check ITERATOR_P.
	(readonly_warning): Likewise.
	* gcc/tree.h (ITERATOR_BOUND_P): Don't mention it.

	* Make-lang.in (cc1chill): Don't depend on c-iterate.o.

	* gcc.dg/noncompile/930622-2.c: Adjust error message.

From-SVN: r35967
parent aee3c6b0
2000-08-24 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o.
(c-iterate.o): Remove target.
* gcc/c-common.h (enum rid): Remove RID_ITERATOR.
* gcc/c-decl.c (init_decl_processing): Remove call to init_iterators.
(finish_decl): Don't handle iterators.
(grokdeclarator): Likewise.
* gcc/c-parse.gperf: Remove __iterator and __iterator__ keywords.
* gcc/c-gperf.h: Regenerated.
* gcc/c-iterate.c: Removed.
* gcc/c-lex.c (init_lex): Don't handle iterators.
* gcc/c-parse.in (primary): Remove pop_iterator_stack call.
(compstmt_primary_start): Remove push_iterator_stack call.
(stmt): Don't allow iterator statements. Replace iterator_expand
with expand_expr_stmt.
(all_iter_stmt): Remove.
(all_iter_stmt_simple): Likewise.
(all_iter_stmt_with_decl): Likewise.
* gcc/c-tree.h (ITERATOR_P): Remove.
(ITERATOR_BOUND_P): Likewise.
(init_iterators): Remove declaration.
(iterator_expand): Likewise.
(iterator_for_loop_start): Likewise.
(iterator_for_loop_end): Likewise.
(iterator_for_loop_record): Likewise.
(push_iterator_stack): Likewise.
(pop_iterator_stack): Likewise.
* gcc/c-typeck.c (decl_constant_value): Don't check ITERATOR_P.
(readonly_warning): Likewise.
* gcc/tree.h (ITERATOR_BOUND_P): Don't mention it.
2000-08-24 Jim Wilson <wilson@cygnus.com>
* c-common.c (decl_attributes, case A_ALIGN): Revert last change.
......
......@@ -678,7 +678,7 @@ LANG_FLAGS_TO_PASS = $(SUBDIR_FLAGS_TO_PASS) \
# Language-specific object files for C and Objective C.
C_AND_OBJC_OBJS = c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
c-convert.o c-aux-info.o c-common.o c-iterate.o c-semantics.o @extra_c_objs@
c-convert.o c-aux-info.o c-common.o c-semantics.o @extra_c_objs@
# Language-specific object files for C.
C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
......@@ -1111,8 +1111,6 @@ c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h \
c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) function.h \
defaults.h c-pragma.h toplev.h $(GGC_H)
c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \
c-common.h flags.h toplev.h $(EXPR_H)
mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h
graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \
function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
......
......@@ -64,7 +64,6 @@ enum rid
RID_BOUNDED,
RID_UNBOUNDED,
RID_NOALIAS,
RID_ITERATOR,
RID_COMPLEX,
RID_IN,
......
......@@ -3199,8 +3199,6 @@ init_decl_processing ()
/* Prepare to check format strings against argument lists. */
init_function_format_info ();
init_iterators ();
incomplete_decl_finalize_hook = finish_incomplete_decl;
/* Record our roots. */
......@@ -3580,14 +3578,6 @@ finish_decl (decl, init, asmspec_tree)
if (TREE_CODE (decl) == PARM_DECL)
init = 0;
if (ITERATOR_P (decl))
{
if (init == 0)
error_with_decl (decl, "iterator has no initial value");
else
init = save_expr (init);
}
if (init)
{
if (TREE_CODE (decl) != TYPE_DECL)
......@@ -4254,7 +4244,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if (specbits & 1 << (int) RID_EXTERN) nclasses++;
if (specbits & 1 << (int) RID_REGISTER) nclasses++;
if (specbits & 1 << (int) RID_TYPEDEF) nclasses++;
if (specbits & 1 << (int) RID_ITERATOR) nclasses++;
/* Warn about storage classes that are invalid for certain
kinds of declarations (parameters, typenames, etc.). */
......@@ -4315,18 +4304,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
else if (current_binding_level == global_binding_level
&& specbits & (1 << (int) RID_AUTO))
error ("top-level declaration of `%s' specifies `auto'", name);
else if ((specbits & 1 << (int) RID_ITERATOR)
&& TREE_CODE (declarator) != IDENTIFIER_NODE)
{
error ("iterator `%s' has derived type", name);
type = error_mark_node;
}
else if ((specbits & 1 << (int) RID_ITERATOR)
&& TREE_CODE (type) != INTEGER_TYPE)
{
error ("iterator `%s' has noninteger type", name);
type = error_mark_node;
}
}
/* Now figure out the structure of the declarator proper.
......@@ -4879,9 +4856,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
TREE_STATIC (decl) = (specbits & (1 << (int) RID_STATIC)) != 0;
TREE_PUBLIC (decl) = DECL_EXTERNAL (decl);
}
if (specbits & 1 << (int) RID_ITERATOR)
ITERATOR_P (decl) = 1;
}
/* Record `register' declaration for warnings on &
......
......@@ -300,7 +300,6 @@ init_lex ()
ridpointers[(int) RID_EXTERN] = get_identifier ("extern");
ridpointers[(int) RID_TYPEDEF] = get_identifier ("typedef");
ridpointers[(int) RID_REGISTER] = get_identifier ("register");
ridpointers[(int) RID_ITERATOR] = get_identifier ("iterator");
ridpointers[(int) RID_COMPLEX] = get_identifier ("complex");
ridpointers[(int) RID_ID] = get_identifier ("id");
ridpointers[(int) RID_IN] = get_identifier ("in");
......@@ -328,7 +327,6 @@ init_lex ()
UNSET_RESERVED_WORD ("typeof");
UNSET_RESERVED_WORD ("signed");
UNSET_RESERVED_WORD ("inline");
UNSET_RESERVED_WORD ("iterator");
UNSET_RESERVED_WORD ("complex");
}
else if (!flag_isoc99)
......@@ -340,7 +338,6 @@ init_lex ()
UNSET_RESERVED_WORD ("typeof");
if (! flag_isoc99)
UNSET_RESERVED_WORD ("inline");
UNSET_RESERVED_WORD ("iterator");
UNSET_RESERVED_WORD ("complex");
}
}
......
......@@ -41,8 +41,6 @@ __imag, IMAGPART, NORID
__imag__, IMAGPART, NORID
__inline, SCSPEC, RID_INLINE
__inline__, SCSPEC, RID_INLINE
__iterator, SCSPEC, RID_ITERATOR
__iterator__, SCSPEC, RID_ITERATOR
__label__, LABEL, NORID
__ptrbase, PTR_BASE, NORID
__ptrbase__, PTR_BASE, NORID
......
......@@ -656,7 +656,6 @@ primary:
{ tree rtl_exp;
if (pedantic)
pedwarn ("ISO C forbids braced-groups within expressions");
pop_iterator_stack ();
pop_label_level ();
rtl_exp = expand_end_stmt_expr ($1);
/* The statements have side effects, so the group does. */
......@@ -679,7 +678,6 @@ primary:
{
/* Make sure we call expand_end_stmt_expr. Otherwise
we are likely to lose sequences and crash later. */
pop_iterator_stack ();
pop_label_level ();
expand_end_stmt_expr ($1);
$$ = error_mark_node;
......@@ -1673,7 +1671,6 @@ compstmt_primary_start:
there is a way to turn off the entire subtree of blocks
that are contained in it. */
keep_next_level ();
push_iterator_stack ();
push_label_level ();
$$ = expand_start_stmt_expr ();
compstmt_count++;
......@@ -1753,7 +1750,6 @@ stmt_or_label:
stmt:
compstmt
{ stmt_count++; }
| all_iter_stmt
| expr ';'
{ stmt_count++;
emit_line_note ($<filename>-1, $<lineno>0);
......@@ -1769,7 +1765,7 @@ stmt:
|| TREE_CODE (TREE_TYPE ($1)) == FUNCTION_TYPE)
$1 = default_conversion ($1);
#endif
iterator_expand ($1); }
expand_expr_stmt ($1); }
| simple_if ELSE
{ c_expand_start_else ();
$<itype>1 = stmt_count;
......@@ -1933,60 +1929,6 @@ stmt:
| ';'
;
all_iter_stmt:
all_iter_stmt_simple
/* | all_iter_stmt_with_decl */
;
all_iter_stmt_simple:
FOR '(' primary ')'
{
/* The value returned by this action is */
/* 1 if everything is OK */
/* 0 in case of error or already bound iterator */
$<itype>$ = 0;
if (TREE_CODE ($3) != VAR_DECL)
error ("invalid `for (ITERATOR)' syntax");
else if (! ITERATOR_P ($3))
error ("`%s' is not an iterator",
IDENTIFIER_POINTER (DECL_NAME ($3)));
else if (ITERATOR_BOUND_P ($3))
error ("`for (%s)' inside expansion of same iterator",
IDENTIFIER_POINTER (DECL_NAME ($3)));
else
{
$<itype>$ = 1;
iterator_for_loop_start ($3);
}
}
lineno_labeled_stmt
{
if ($<itype>5)
iterator_for_loop_end ($3);
}
/* This really should allow any kind of declaration,
for generality. Fix it before turning it back on.
all_iter_stmt_with_decl:
FOR '(' ITERATOR pushlevel setspecs iterator_spec ')'
{
*/ /* The value returned by this action is */
/* 1 if everything is OK */
/* 0 in case of error or already bound iterator */
/*
iterator_for_loop_start ($6);
}
lineno_labeled_stmt
{
iterator_for_loop_end ($6);
emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), 1, 0);
$<ttype>$ = poplevel (1, 1, 0);
}
*/
/* Any kind of label, including jump labels and case labels.
ANSI C accepts labels only before statements, but we allow them
also at the end of a compound statement. */
......
......@@ -126,12 +126,6 @@ struct lang_type
/* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */
#define DECL_C_BIT_FIELD(NODE) DECL_LANG_FLAG_4 (NODE)
/* In a VAR_DECL, means the variable is really an iterator. */
#define ITERATOR_P(D) (DECL_LANG_FLAG_4(D))
/* In a VAR_DECL for an iterator, means we are within
an explicit loop over that iterator. */
#define ITERATOR_BOUND_P(NODE) ((NODE)->common.readonly_flag)
/* in c-lang.c and objc-act.c */
extern tree lookup_interface PARAMS ((tree));
......@@ -262,15 +256,6 @@ extern void process_init_element PARAMS ((tree));
extern void pedwarn_c99 PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1;
/* in c-iterate.c */
extern void init_iterators PARAMS ((void));
extern void iterator_expand PARAMS ((tree));
extern void iterator_for_loop_start PARAMS ((tree));
extern void iterator_for_loop_end PARAMS ((tree));
extern void iterator_for_loop_record PARAMS ((tree));
extern void push_iterator_stack PARAMS ((void));
extern void pop_iterator_stack PARAMS ((void));
/* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */
......
......@@ -847,7 +847,7 @@ decl_constant_value (decl)
current_function_decl != 0
&& ! pedantic
&& ! TREE_THIS_VOLATILE (decl)
&& TREE_READONLY (decl) && ! ITERATOR_P (decl)
&& TREE_READONLY (decl)
&& DECL_INITIAL (decl) != 0
&& TREE_CODE (DECL_INITIAL (decl)) != ERROR_MARK
/* This is invalid if initial value is not constant.
......@@ -3280,11 +3280,6 @@ readonly_warning (arg, msgid)
tree arg;
const char *msgid;
{
/* Forbid assignments to iterators. */
if (TREE_CODE (arg) == VAR_DECL && ITERATOR_P (arg))
pedwarn ("%s of iterator `%s'", _(msgid),
IDENTIFIER_POINTER (DECL_NAME (arg)));
if (TREE_CODE (arg) == COMPONENT_REF)
{
if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
......
2000-08-24 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (cc1chill): Don't depend on c-iterate.o.
2000-08-21 Nix <nix@esperi.demon.co.uk>
* lang-specs.h: Do not process -o or run the assembler if
......
# Top level Makefile fragment for GNU CHILL.
# Copyright (C) 1994, 1998 Free Software Foundation, Inc.
# Copyright (C) 1994, 1998, 2000 Free Software Foundation, Inc.
#This file is part of GNU CC.
......@@ -95,7 +95,7 @@ chill-cross: $(srcdir)/ch/chill.in
cc1chill$(exeext): $(P) $(CHILL_SRCS) $(LIBDEPS) $(BACKEND) \
insn-config.h insn-flags.h insn-attr.h insn-codes.h \
c-typeck.o c-aux-info.o c-common.o c-iterate.o \
c-typeck.o c-aux-info.o c-common.o \
ggc-callbacks.o
cd ch; $(MAKE) $(LANG_FLAGS_TO_PASS) $(CHILL_FLAGS_TO_PASS) ../cc1chill$(exeext)
......
2000-08-24 Mark Mitchell <mark@codesourcery.com>
* gcc.dg/noncompile/930622-2.c: Adjust error message.
2000-08-24 Richard Henderson <rth@cygnus.com>
* gcc.dg/ia64-sync-1.c: New test.
......
f ()
{
int i;
for (i--) /* { dg-error "syntax" } */
for (i--) /* { dg-error "parse" } */
;
}
......@@ -219,8 +219,6 @@ struct tree_common
TREE_READONLY in
all expressions
ITERATOR_BOUND_P in
VAR_DECL if iterator (C)
TYPE_READONLY in
..._TYPE
......
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