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]

PATCH: Introducing grokparm()


Next on my ObjC++ integration list is the grokparm() function, which
I need to call from c-parse.in.  After my c-parse.in changes get
integrated, I will then remove the groktypename_in_parm_context()
function, which will no longer be needed.

I will commit this as obvious.

[gcc/ChangeLog]
2004-08-25  Ziemowit Laski  <zlaski@apple.com>

        * c-decl.c (grokparm): New function.
        * c-tree.h (grokparm): New prototype.

Index: gcc/c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.562
diff -u -3 -p -r1.562 c-decl.c
--- gcc/c-decl.c        25 Aug 2004 09:51:19 -0000      1.562
+++ gcc/c-decl.c        25 Aug 2004 23:01:34 -0000
@@ -3153,6 +3153,20 @@ finish_decl (tree decl, tree init, tree
     }
 }

+/* Given a parsed parameter declaration, decode it into a PARM_DECL. */
+
+tree
+grokparm (tree parm)
+{
+ tree decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)),
+ TREE_PURPOSE (TREE_PURPOSE (parm)),
+ PARM, 0, NULL);
+
+ decl_attributes (&decl, TREE_VALUE (parm), 0);
+
+ return decl;
+}
+
/* Given a parsed parameter declaration, decode it into a PARM_DECL
and push that on the current scope. */


Index: gcc/c-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-tree.h,v
retrieving revision 1.168
diff -u -3 -p -r1.168 c-tree.h
--- gcc/c-tree.h        22 Aug 2004 13:02:01 -0000      1.168
+++ gcc/c-tree.h        25 Aug 2004 23:01:34 -0000
@@ -180,6 +180,7 @@ extern tree get_parm_info (bool);
 extern tree grokfield (tree, tree, tree);
 extern tree groktypename (tree);
 extern tree groktypename_in_parm_context (tree);
+extern tree grokparm (tree);
 extern tree implicitly_declare (tree);
 extern void keep_next_level (void);
 extern tree lookup_name (tree);

--------------------------------------------------------------
Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477


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