aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-09-09 02:19:15 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-09-09 02:19:15 +0100
commitf8893e4723c8ce3462bfd1298afde78e5327c260 (patch)
treeb2e10c479b481502bc955872a928817f6c0ba1b9 /gcc/objc
parentbc4b653be6451211226018f96146a1eaa439b6cd (diff)
downloadgcc-f8893e4723c8ce3462bfd1298afde78e5327c260.zip
gcc-f8893e4723c8ce3462bfd1298afde78e5327c260.tar.gz
gcc-f8893e4723c8ce3462bfd1298afde78e5327c260.tar.bz2
c-tree.h (enum c_declarator_kind, [...]): New.
* c-tree.h (enum c_declarator_kind, struct c_arg_info, struct c_declarator, struct c_type_name, struct c_parm): New. (build_array_declarator, set_array_declarator_inner, get_parm_info, grokfield, groktypename, grokparm, push_parm_decl, start_function, start_decl, build_c_parm, build_attrs_declarator, build_function_declarator, make_pointer_declarator, c_cast_expr, store_parm_decls_newstyle, c_expr_sizeof_type): Update prototypes. (build_id_declarator): New. * c-typeck.c (c_cast_expr, c_expr_sizeof_type): Update to new structures. * c-decl.c (ARG_INFO_PARMS, ARG_INFO_TAGS, ARG_INFO_TYPES, ARG_INFO_OTHERS): Remove. (build_id_declarator): New. (build_array_declarator, set_array_declarator_inner, groktypename, start_decl, grokparm, push_parm_decl, grokparms, get_parm_info, grokfield, start_function, store_parm_decls_newstyle, store_parm_decls_oldstyle, store_parm_decls, build_c_parm, build_attrs_declarator, build_function_declarator, make_pointer_declarator, grokdeclarator): Update to new structures. * c-parse.in (%union): Add arginfotype, dtrtype, typenametype and parmtype. (declarator, notype_declarator, after_type_declarator, parm_declarator, parm_declarator_starttypename, parm_declarator_nostarttypename, array_declarator, typename, absdcl, absdcl1, absdcl1_ea, absdcl1_noea, direct_absdcl1, absdcl_maybe_attribute, parm, firstparm, parms, parmlist, parmlist_1, parmlist_2, parmlist_or_identifiers, parmlist_or_identifiers_1): Use these types. (primary, after_type_declarator, parm_declarator_starttypename, notype_declarator, component_decl, component_declarator, component_notype_declarator, typename, absdcl, absdcl_maybe_attribute, absdcl1_ea, direct_absdcl1, parmlist_1, parmlist_2, parmlist_or_identifiers_1): Update to new structures. objc: * objc-act.c (objc_start_function, really_start_method, objc_get_parm_info, start_method_def): Update to new arg_info structures. From-SVN: r87217
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-act.c58
2 files changed, 53 insertions, 11 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 53e6a28..bfee615 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-09 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * objc-act.c (objc_start_function, really_start_method,
+ objc_get_parm_info, start_method_def): Update to new arg_info
+ structures.
+
2004-09-07 Ziemowit Laski <zlaski@apple.com>
* Make-lang.in (objc/objc-parse.o): Depend on $(C_COMMON_H) instead of
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 00dd3df..f115ba4 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -156,7 +156,11 @@ static tree start_class (enum tree_code, tree, tree, tree);
static tree continue_class (tree);
static void finish_class (tree);
static void start_method_def (tree);
+#ifdef OBJCPLUS
static void objc_start_function (tree, tree, tree, tree);
+#else
+static void objc_start_function (tree, tree, tree, struct c_arg_info *);
+#endif
static tree start_protocol (enum tree_code, tree, tree);
static tree build_method_decl (enum tree_code, tree, tree, tree);
static tree objc_add_method (tree, tree, int);
@@ -244,12 +248,20 @@ static void encode_gnu_bitfield (int, tree, int);
static void encode_type (tree, int, int);
static void encode_field_decl (tree, int, int);
+#ifdef OBJCPLUS
static void really_start_method (tree, tree);
+#else
+static void really_start_method (tree, struct c_arg_info *);
+#endif
static int objc_types_are_equivalent (tree, tree);
static int comp_proto_with_proto (tree, tree);
static tree get_arg_type_list (tree, int, int);
static void objc_push_parm (tree);
+#ifdef OBJCPLUS
static tree objc_get_parm_info (int);
+#else
+static struct c_arg_info *objc_get_parm_info (int);
+#endif
static void synth_self_and_ucmd_args (void);
/* Utilities for debugging and error diagnostics. */
@@ -7338,16 +7350,22 @@ objc_push_parm (tree parm)
/* Retrieve the formal paramter list constructed via preceding calls to
objc_push_parm(). */
-static tree
#ifdef OBJCPLUS
+static tree
objc_get_parm_info (int have_ellipsis ATTRIBUTE_UNUSED)
#else
+static struct c_arg_info *
objc_get_parm_info (int have_ellipsis)
#endif
{
+#ifdef OBJCPLUS
tree parm_info = objc_parmlist;
+ objc_parmlist = NULL_TREE;
-#ifndef OBJCPLUS
+ return parm_info;
+#else
+ tree parm_info = objc_parmlist;
+ struct c_arg_info *arg_info;
/* The C front-end requires an elaborate song and dance at
this point. */
push_scope ();
@@ -7360,12 +7378,11 @@ objc_get_parm_info (int have_ellipsis)
pushdecl (parm_info);
parm_info = next;
}
- parm_info = get_parm_info (have_ellipsis);
+ arg_info = get_parm_info (have_ellipsis);
pop_scope ();
-#endif
objc_parmlist = NULL_TREE;
-
- return parm_info;
+ return arg_info;
+#endif
}
/* Synthesize the formal parameters 'id self' and 'SEL _cmd' needed for ObjC
@@ -7400,6 +7417,11 @@ static void
start_method_def (tree method)
{
tree parmlist;
+#ifdef OBJCPLUS
+ tree parm_info;
+#else
+ struct c_arg_info *parm_info;
+#endif
int have_ellipsis = 0;
/* Required to implement _msgSuper. */
@@ -7434,9 +7456,9 @@ start_method_def (tree method)
have_ellipsis = 1;
}
- parmlist = objc_get_parm_info (have_ellipsis);
+ parm_info = objc_get_parm_info (have_ellipsis);
- really_start_method (objc_method_context, parmlist);
+ really_start_method (objc_method_context, parm_info);
}
static void
@@ -7509,11 +7531,19 @@ comp_proto_with_proto (tree proto1, tree proto2)
}
static void
-objc_start_function (tree name, tree type, tree attrs, tree params)
+objc_start_function (tree name, tree type, tree attrs,
+#ifdef OBJCPLUS
+ tree params
+#else
+ struct c_arg_info *params
+#endif
+ )
{
tree fndecl = build_decl (FUNCTION_DECL, name, type);
+#ifdef OBJCPLUS
DECL_ARGUMENTS (fndecl) = params;
+#endif
DECL_INITIAL (fndecl) = error_mark_node;
DECL_EXTERNAL (fndecl) = 0;
TREE_STATIC (fndecl) = 1;
@@ -7532,7 +7562,7 @@ objc_start_function (tree name, tree type, tree attrs, tree params)
= build_decl (RESULT_DECL, NULL_TREE,
TREE_TYPE (TREE_TYPE (current_function_decl)));
start_fname_decls ();
- store_parm_decls_from (DECL_ARGUMENTS (current_function_decl));
+ store_parm_decls_from (params);
#endif
TREE_USED (current_function_decl) = 1;
@@ -7545,7 +7575,13 @@ objc_start_function (tree name, tree type, tree attrs, tree params)
- If we have a prototype, check for type consistency. */
static void
-really_start_method (tree method, tree parmlist)
+really_start_method (tree method,
+#ifdef OBJCPLUS
+ tree parmlist
+#else
+ struct c_arg_info *parmlist
+#endif
+ )
{
tree ret_type, meth_type;
tree method_id;