This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[cs] some small compile-server patches


I checked in the following miscellaneous patches into the compile server branch.
--
--Per Bothner
per@bothner.com pbothner@apple.com http://per.bothner.com/
2003-10-29  Per Bothner  <pbothner@apple.com>

	* function.c (init_function_once):  Reset funcdef_no.
	* varasm.c (init_varasm_once):  Reset const_labelno.

2003-10-29  Per Bothner  <pbothner@apple.com>

	* c-patch.in (maybe_identifier):  New non-terminal.
	(structsp_attr):  Use maybe_identifier to combine_case.  Not only
	is this simpler, but it calls finish_struct before parsing body,
	which is needed for compiler-server to adjust currently_nested.

2003-10-29  Per Bothner  <pbothner@apple.com>

	* cpphash.h (struct cpp_fragment):  Fields start_line and end_line
	are fileline instances.

diff -up old/c-parse.in new/c-parse.in
--- old/c-parse.in	Wed Oct 29 11:16:08 2003
+++ new/c-parse.in	Wed Oct 29 11:17:03 2003
@@ -181,7 +181,8 @@ do {									\
 %type <ttype> ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
 %type <ttype> BREAK CONTINUE RETURN GOTO ASM_KEYWORD SIZEOF TYPEOF ALIGNOF
 
-%type <ttype> identifier IDENTIFIER TYPENAME CONSTANT expr nonnull_exprlist exprlist
+%type <ttype> identifier maybe_identifier IDENTIFIER
+%type <ttype> TYPENAME CONSTANT expr nonnull_exprlist exprlist
 %type <ttype> expr_no_commas cast_expr unary_expr primary STRING
 %type <ttype> declspecs_nosc_nots_nosa_noea declspecs_nosc_nots_nosa_ea
 %type <ttype> declspecs_nosc_nots_sa_noea declspecs_nosc_nots_sa_ea
@@ -1708,6 +1709,13 @@ enum_head:
 		{ $$ = $2; }
 	;
 
+maybe_identifier:
+	  /* empty */
+		{ $$ = NULL_TREE; }
+	| identifier
+		{ $$ = $1; }
+	;
+
 /* structsp_attr: struct/union/enum specifiers that either
    end with attributes, or are such that any following attributes would
    be parsed as part of the struct/union/enum specifier.
@@ -1715,36 +1723,23 @@ enum_head:
    structsp_nonattr: other struct/union/enum specifiers.  */
 
 structsp_attr:
-	  struct_head identifier '{'
+	  struct_head maybe_identifier '{'
 		{ $$ = start_struct (RECORD_TYPE, $2);
 		  /* Start scope of tag before parsing components.  */
 		}
 	  component_decl_list '}' maybe_attribute
 		{ $$ = finish_struct ($<ttype>4, nreverse ($5),
 				      chainon ($1, $7)); }
-	| struct_head '{' component_decl_list '}' maybe_attribute
-		{ $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
-				      nreverse ($3), chainon ($1, $5));
-		}
-	| union_head identifier '{'
+	| union_head maybe_identifier '{'
 		{ $$ = start_struct (UNION_TYPE, $2); }
 	  component_decl_list '}' maybe_attribute
 		{ $$ = finish_struct ($<ttype>4, nreverse ($5),
 				      chainon ($1, $7)); }
-	| union_head '{' component_decl_list '}' maybe_attribute
-		{ $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
-				      nreverse ($3), chainon ($1, $5));
-		}
-	| enum_head identifier '{'
+	| enum_head maybe_identifier '{'
 		{ $$ = start_enum ($2); }
 	  enumlist maybecomma_warn '}' maybe_attribute
 		{ $$ = finish_enum ($<ttype>4, nreverse ($5),
 				    chainon ($1, $8)); }
-	| enum_head '{'
-		{ $$ = start_enum (NULL_TREE); }
-	  enumlist maybecomma_warn '}' maybe_attribute
-		{ $$ = finish_enum ($<ttype>3, nreverse ($4),
-				    chainon ($1, $7)); }
 	;
 
 structsp_nonattr:
diff -up old/cpphash.h new/cpphash.h
--- old/cpphash.h	Wed Oct 29 11:16:08 2003
+++ new/cpphash.h	Wed Oct 29 11:17:03 2003
@@ -266,8 +266,8 @@ struct cpp_fragment
   unsigned was_reused : 1;
   /*unsigned int valid : 1;*/
   void *start_marker;		/* Returned from front-end - kludge. */
-  unsigned int start_line;
-  unsigned int end_line;
+  fileline start_line;
+  fileline end_line;
   const unsigned char *end_next_line;
   struct cpp_macro_note *macro_notes;
   int macro_notes_count;
diff -up old/function.c new/function.c
--- old/function.c	Wed Oct 29 11:16:08 2003
+++ new/function.c	Wed Oct 29 11:17:03 2003
@@ -7968,6 +7968,8 @@ init_function_once (void)
   VARRAY_INT_INIT (prologue, 0, "prologue");
   VARRAY_INT_INIT (epilogue, 0, "epilogue");
   VARRAY_INT_INIT (sibcall_epilogue, 0, "sibcall_epilogue");
+
+  funcdef_no = 0;
 }
 
 #include "gt-function.h"
diff -up old/varasm.c new/varasm.c
--- old/varasm.c	Wed Oct 29 11:16:08 2003
+++ new/varasm.c	Wed Oct 29 11:17:03 2003
@@ -4451,6 +4451,7 @@ init_varasm_once (void)
 				     const_desc_eq, NULL);
 
   const_alias_set = new_alias_set ();
+  const_labelno = 0;
 }
 
 enum tls_model

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]