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]

[incremental] Patch: FYI: various identifier GC fixlets


I'm checking this in on the incremental-compiler branch.

This is a few miscellaneous identifier GC fixes, all minor.  This
initializes ggc_protect_identifiers earlier, fixes a few typos, and
disallows copying of identifier nodes.

Tom

ChangeLog:
2008-03-19  Tom Tromey  <tromey@redhat.com>

	* toplev.c (do_compile): Set ggc_protect_identifiers here...
	(compile_file): ... not here.
	* tree.h (struct tree_identifier): Fix typo.
	* tree.c (tree_code_size): Disallow identifiers.

cp/ChangeLog:
2008-03-19  Tom Tromey  <tromey@redhat.com>

	* mangle.c (finish_mangling_get_identifier): Fix typo.

Index: tree.c
===================================================================
--- tree.c	(revision 132956)
+++ tree.c	(working copy)
@@ -1,6 +1,6 @@
 /* Language-independent node constructors for parse phase of GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -341,7 +341,8 @@
 
 /* Compute the number of bytes occupied by a tree with code CODE.
    This function cannot be used for nodes that have variable sizes,
-   including TREE_VEC, PHI_NODE, STRING_CST, and CALL_EXPR.  */
+   including TREE_VEC, PHI_NODE, STRING_CST, IDENTIFIER_NODE, and
+   CALL_EXPR.  */
 size_t
 tree_code_size (enum tree_code code)
 {
@@ -411,12 +412,12 @@
     case tcc_exceptional:  /* something random, like an identifier.  */
       switch (code)
 	{
-	case IDENTIFIER_NODE:	return lang_hooks.identifier_size;
 	case TREE_LIST:		return sizeof (struct tree_list);
 
 	case ERROR_MARK:
 	case PLACEHOLDER_EXPR:	return sizeof (struct tree_common);
 
+	case IDENTIFIER_NODE:
 	case TREE_VEC:
 	case OMP_CLAUSE:
 	case PHI_NODE:		gcc_unreachable ();
Index: tree.h
===================================================================
--- tree.h	(revision 132956)
+++ tree.h	(working copy)
@@ -1497,7 +1497,7 @@
 struct tree_identifier GTY(())
 {
   struct tree_common common;
-  /* Note that every front end's tree_identifier must include an
+  /* Note that every front end's lang_identifier must include an
      ht_identifier structure at the end.  */
 };
 
Index: toplev.c
===================================================================
--- toplev.c	(revision 132956)
+++ toplev.c	(working copy)
@@ -1101,8 +1101,6 @@
 {
   /* Initialize yet another pass.  */
 
-  ggc_protect_identifiers = true;
-
   init_cgraph ();
   init_final (main_input_filename);
   coverage_init (aux_base_name);
@@ -2382,6 +2380,8 @@
     timevar_init ();
   timevar_start (TV_TOTAL);
 
+  ggc_protect_identifiers = true;
+
   process_options ();
 
   /* Don't do any more if an error has already occurred.  */
Index: cp/mangle.c
===================================================================
--- cp/mangle.c	(revision 133351)
+++ cp/mangle.c	(revision 133352)
@@ -2561,7 +2561,7 @@
 {
   finish_mangling_internal (warn);
   /* Don't obstack_finish here, and the next start_mangling will
-     remove the identifer.  */
+     remove the identifier.  */
   return get_identifier ((const char *) name_base);
 }
 


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