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: Yet another ObjC-ish "hook" in c-decl.c


A recent modification to store_parm_decls() broke the ongoing ObjC integration
again :-(. In its new form, store_parm_decls() is no longer usable from ObjC,
because it dereferences the newfangled 'current_function_arg_info' static variable,
which only grokdeclarator() sets. The new objc-act.c no longer calls any of the
grok...() functions, since it no longer deals in raw declspec goo.


So, I introduce process_parm_decls(), which future ObjC will call instead
of store_parm_decls(). I'm inclined to commit this as obvious since this
solves ObjC's problems and cannot possibly cause any problems for C, but I'll
wait a short while for people's thoughts, if any.


--Zem

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

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

Index: gcc/c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.569
diff -u -3 -p -r1.569 c-decl.c
--- gcc/c-decl.c        1 Sep 2004 20:09:16 -0000       1.569
+++ gcc/c-decl.c        2 Sep 2004 22:39:43 -0000
@@ -6438,6 +6438,16 @@ store_parm_decls_oldstyle (tree fndecl,
     }
 }

+/* Process parameter declarations (already installed in their final
+ resting place) for the current function declaration. */
+
+void
+process_parm_decls (void)
+{
+ store_parm_decls_newstyle (current_function_decl,
+ DECL_ARGUMENTS (current_function_decl));
+}
+
/* Store the parameter declarations into the current function declaration.
This is called after parsing the parameter declarations, before
digesting the body of the function.
Index: gcc/c-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-tree.h,v
retrieving revision 1.173
diff -u -3 -p -r1.173 c-tree.h
--- gcc/c-tree.h 31 Aug 2004 08:29:24 -0000 1.173
+++ gcc/c-tree.h 2 Sep 2004 22:39:43 -0000
@@ -200,6 +200,7 @@ extern tree start_enum (tree);
extern int start_function (tree, tree, tree);
extern tree start_decl (tree, tree, bool, tree);
extern tree start_struct (enum tree_code, tree);
+extern void process_parm_decls (void);
extern void store_parm_decls (void);
extern tree xref_tag (enum tree_code, tree);
extern int c_expand_decl (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]