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]

[static-tree] get identifiers out of parameter tag list


I wasn't sure if this would work (not least because the comment said
'tags' and the variables were 'decl' but the list actually has types),
so I tested it separately.

Bootstrapped & tested on powerpc-darwin, C only.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-statt-parmtaglist.patch===============
2004-10-04  Geoffrey Keating  <geoffk@apple.com>

	* c-decl.c (get_parm_info): Don't save b->id in the TREE_PURPOSE
	of the list element.
	(store_parm_decls_newstyle): Use TYPE_NAME of the type rather than
	* c-tree.h (struct c_arg_info): Correct comment for field 'tags'.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.592.2.1
diff -u -p -u -p -r1.592.2.1 c-decl.c
--- c-decl.c	1 Oct 2004 02:30:32 -0000	1.592.2.1
+++ c-decl.c	5 Oct 2004 04:56:11 -0000
@@ -4834,7 +4834,7 @@ get_parm_info (bool ellipsis)
 		}
 	    }
 
-	  tags = tree_cons (b->id, decl, tags);
+	  tags = tree_cons (NULL_TREE, decl, tags);
 	  break;
 
 	case CONST_DECL:
@@ -5873,8 +5873,8 @@ store_parm_decls_newstyle (tree fndecl, 
 
   /* And all the tag declarations.  */
   for (decl = arg_info->tags; decl; decl = TREE_CHAIN (decl))
-    if (TREE_PURPOSE (decl))
-      bind (TREE_PURPOSE (decl), TREE_VALUE (decl), current_scope,
+    if (TYPE_NAME (TREE_VALUE (decl)))
+      bind (TYPE_NAME (TREE_VALUE (decl)), TREE_VALUE (decl), current_scope,
 	    /*invisible=*/false, /*nested=*/false);
 }
 
Index: c-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-tree.h,v
retrieving revision 1.185.2.1
diff -u -p -u -p -r1.185.2.1 c-tree.h
--- c-tree.h	1 Oct 2004 02:30:39 -0000	1.185.2.1
+++ c-tree.h	5 Oct 2004 04:56:12 -0000
@@ -230,7 +230,7 @@ enum c_declarator_kind {
 struct c_arg_info {
   /* A list of parameter decls.  */
   tree parms;
-  /* A list of structure, union and enum tags defined.  */
+  /* A list of structure, union and enum types defined.  */
   tree tags;
   /* A list of argument types to go in the FUNCTION_TYPE.  */
   tree types;
============================================================


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