[RFA]: Remove indent_level stuff.
Neil Booth
neil@daikokuya.demon.co.uk
Wed May 22 23:53:00 GMT 2002
As discussed recently, this hasn't been turned on since 2.95.3.
Bootstrapped without regressions x86 Linux. OK to commit?
Neil.
* c-lex.c (indent_level): Remove.
(cb_file_change, c_lex): Remove indent level handling.
* c-lex.h (indent_level): Remove.
* input.h (struct file_stack): Remove indent_level.
* toplev.c (push_srcloc): Remove indent_level handling.
cp:
* spew.c (yyungetc, snarf_block): Remove indent_level handling.
============================================================
Index: gcc/c-lex.c
--- gcc/c-lex.c 9 May 2002 22:48:32 -0000 1.177
+++ gcc/c-lex.c 23 May 2002 06:12:54 -0000
@@ -67,7 +67,6 @@ extern FILE *asm_out_file;
/* Number of bytes in a wide character. */
#define WCHAR_BYTES (WCHAR_TYPE_SIZE / BITS_PER_UNIT)
-int indent_level; /* Number of { minus number of }. */
int pending_lang_change; /* If we need to switch languages - C++ only */
int c_header_level; /* depth in C headers - C++ only */
@@ -271,7 +270,6 @@ cb_file_change (pfile, new_map)
lineno = included_at;
push_srcloc (new_map->to_file, 1);
- input_file_stack->indent_level = indent_level;
(*debug_hooks->start_source_file) (included_at, new_map->to_file);
#ifndef NO_IMPLICIT_EXTERN_C
if (c_header_level)
@@ -294,16 +292,6 @@ cb_file_change (pfile, new_map)
--pending_lang_change;
}
#endif
-#if 0
- if (indent_level != input_file_stack->indent_level)
- {
- warning_with_file_and_line
- (input_filename, lineno,
- "this file contains more '%c's than '%c's",
- indent_level > input_file_stack->indent_level ? '{' : '}',
- indent_level > input_file_stack->indent_level ? '}' : '{');
- }
-#endif
pop_srcloc ();
(*debug_hooks->end_source_file) (to_line);
@@ -718,9 +706,6 @@ c_lex (value)
*value = NULL_TREE;
switch (tok->type)
{
- case CPP_OPEN_BRACE: indent_level++; break;
- case CPP_CLOSE_BRACE: indent_level--; break;
-
/* Issue this error here, where we can get at tok->val.c. */
case CPP_OTHER:
if (ISGRAPH (tok->val.c))
============================================================
Index: gcc/c-lex.h
--- gcc/c-lex.h 19 May 2002 21:53:52 -0000 1.31
+++ gcc/c-lex.h 23 May 2002 06:12:54 -0000
@@ -30,8 +30,6 @@ extern tree make_pointer_declarator PARA
extern int c_lex PARAMS ((tree *));
extern const char *init_c_lex PARAMS ((const char *));
-extern int indent_level;
-
struct cpp_reader;
extern struct cpp_reader* parse_in;
============================================================
Index: gcc/input.h
--- gcc/input.h 22 Aug 2001 14:35:19 -0000 1.7
+++ gcc/input.h 23 May 2002 06:12:54 -0000
@@ -36,7 +36,6 @@ struct file_stack
const char *name;
struct file_stack *next;
int line;
- int indent_level;
};
/* Stack of currently pending input files.
============================================================
Index: gcc/toplev.c
--- gcc/toplev.c 22 May 2002 05:40:10 -0000 1.630
+++ gcc/toplev.c 23 May 2002 06:13:13 -0000
@@ -2020,7 +2020,6 @@ push_srcloc (file, line)
fs = (struct file_stack *) xmalloc (sizeof (struct file_stack));
fs->name = input_filename = file;
fs->line = lineno = line;
- fs->indent_level = 0;
fs->next = input_file_stack;
input_file_stack = fs;
input_file_stack_tick++;
============================================================
Index: gcc/cp/spew.c
--- gcc/cp/spew.c 26 Apr 2002 07:40:02 -0000 1.62
+++ gcc/cp/spew.c 23 May 2002 06:13:17 -0000
@@ -891,13 +891,6 @@ yyungetc (ch, rescan)
{
struct token fake;
- /* If we're putting back a brace, undo the change in indent_level
- from the first time we saw it. */
- if (ch == '{')
- indent_level--;
- else if (ch == '}')
- indent_level++;
-
fake.yychar = ch;
fake.yylval.ttype = 0;
fake.lineno = lineno;
@@ -1085,8 +1078,7 @@ snarf_block (starting_file, starting_lin
size_t point;
if (yychar == '{')
- /* We incremented indent_level in yylex; undo that. */
- indent_level--;
+ ;
else if (yychar == '=')
look_for_semicolon = 1;
else if (yychar == ':' || yychar == RETURN_KEYWORD || yychar == TRY)
More information about the Gcc-patches
mailing list