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]

Re: [RFA][objc] Identifier cleanup


David,

This is a good idea, but perhaps I can convince you wait about a week, and then do this on the objc-improvements-branch instead? :-) Among other things, my current objc-improvements-branch mods (not all of them yet committed, due to some DejaGNU regressions) create builtin typedefs for 'id' and 'Class', so that neither needs to be a keyword. I've also folded get_object_reference and get_static_reference into a single routine.

Would that be OK?

Thanks,

--Zem

On 19 Jun 2004, at 11.25, David Ayers wrote:

Hello,

This is another pure mechanical cleanup of objc-act & co. All it does is make some identifier names of a certain class follow a common naming conventions hopefully making the source easier to read. I've also slipped in some minor documentation (and a C mode sequence objc-tree-def). I was told the the ChangeLog should mention all changes so it's a bit verbose.

Bootstrapped and tested on i686-pc-linux-gnu.

Please apply if approved.

Cheers,
David Ayers

PS: Next up... hopefully the removal of the 'id' keyword...
2004-06-19  David Ayers <d.ayers@inode.at>

	* objc/objc-act.h (get_object_reference): Rename to
	get_protocol_reference.
	(super_type): Rename to objc_super_type.
	(selector_type): Rename to objc_selector_type.
	(id_type): Rename to objc_id_type.
	(instance_type): Rename to objc_instance_type.
	(protocol_type): Rename to objc_protocol_type.
	(IS_ID): Update reference to id_type.
	
	* objc/objc-act.c (get_object_reference): Rename to
	get_protocol_reference.  Add documentation.  Update references to
	id_type.

	(lookup_method_in_protocol_list): Rename class_meth to
	is_class.  Add documentation.
	(finish_message_expr): Rename is_class to class_tree.

	(synth_module_prologue, objc_is_object_ptr, objc_build_exc_ptr)
	(next_sjlj_build_try_catch_finally, objc_begin_catch_clause)
	(build_next_objc_exception_stuff, get_arg_type_list)
	(build_objc_method_call): Update references to id_type.
	(synth_module_prologue)
	(build_objc_symtab_template, build_selector_reference_decl)
	(build_selector, build_selector_translation_table)
	(build_typed_selector_reference, get_arg_type_list)
	(synth_self_and_ucmd_args, get_arg_type_list)
	(synth_self_and_ucmd_args):
	Update references to selector_type.
	(build_private_template, build_ivar_reference):	Update references
	to instance_type.
	(synth_module_prologue, build_protocol_reference)
	(build_protocol_expr, start_protocol): Update references to
	protocol_type.
	(synth_module_prologue, get_arg_type_list, build_objc_method_call):
	Update references to super_type.

	* c-parse.in: (typespec_nonreserved_nonattr): Update
	references to get_object_reference.

* objc/objc-tree.def: Add C mode identifier sequence.

Index: gcc/c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.215
diff -u -r1.215 c-parse.in
--- gcc/c-parse.in	18 Jun 2004 01:20:51 -0000	1.215
+++ gcc/c-parse.in	19 Jun 2004 10:29:01 -0000
@@ -1326,12 +1326,12 @@
 	| CLASSNAME protocolrefs
 		{ $$ = get_static_reference ($1, $2); }
 	| OBJECTNAME protocolrefs
-		{ $$ = get_object_reference ($2); }
+		{ $$ = get_protocol_reference ($2); }

 /* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>"
    - nisse@lysator.liu.se */
         | non_empty_protocolrefs
-                { $$ = get_object_reference ($1); }
+                { $$ = get_protocol_reference ($1); }
 @@end_ifobjc
 	| typeof '(' expr ')'
 		{ skip_evaluation--;
Index: gcc/objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.222
diff -u -r1.222 objc-act.c
--- gcc/objc/objc-act.c	18 Jun 2004 01:20:52 -0000	1.222
+++ gcc/objc/objc-act.c	19 Jun 2004 10:29:06 -0000
@@ -538,9 +538,13 @@
   return decl;
 }

+/* Return the first occurrence of a method declaration corresponding
+   to sel_name in rproto_list.  Search rproto_list recursively.
+   If is_class is 0, search for instance methods, otherwise for class
+   methods.  */
 static tree
 lookup_method_in_protocol_list (tree rproto_list, tree sel_name,
-				int class_meth)
+				int is_class)
 {
    tree rproto, p;
    tree fnd = 0;
@@ -551,13 +555,13 @@

 	if (TREE_CODE (p) == PROTOCOL_INTERFACE_TYPE)
 	  {
-	    if ((fnd = lookup_method (class_meth
+	    if ((fnd = lookup_method (is_class
 				      ? PROTOCOL_CLS_METHODS (p)
 				      : PROTOCOL_NST_METHODS (p), sel_name)))
 	      ;
 	    else if (PROTOCOL_LIST (p))
 	      fnd = lookup_method_in_protocol_list (PROTOCOL_LIST (p),
-						    sel_name, class_meth);
+						    sel_name, is_class);
 	  }
 	else
           {
@@ -979,8 +983,9 @@
   return type;
 }

+/* Return a declaration corresponding to a protocol list qualified 'id'. */
tree
-get_object_reference (tree protocols)
+get_protocol_reference (tree protocols)
{
tree type_decl = lookup_name (objc_id_id);
tree type;
@@ -988,7 +993,7 @@
if (type_decl && TREE_CODE (type_decl) == TYPE_DECL)
{
type = TREE_TYPE (type_decl);
- if (TYPE_MAIN_VARIANT (type) != id_type)
+ if (TYPE_MAIN_VARIANT (type) != objc_id_type)
warning ("unexpected type for `id' (%s)",
gen_declaration (type, errbuf));
}
@@ -1139,7 +1144,7 @@


objc_object_reference = xref_tag (RECORD_TYPE, objc_object_id);

-  id_type = build_pointer_type (objc_object_reference);
+  objc_id_type = build_pointer_type (objc_object_reference);

objc_id_id = get_identifier (TYPE_ID);
objc_class_id = get_identifier (TAG_CLASS);
@@ -1147,19 +1152,18 @@
objc_class_type = build_pointer_type (xref_tag (RECORD_TYPE, objc_class_id));
temp_type = get_identifier (PROTOCOL_OBJECT_CLASS_NAME);
objc_declare_class (tree_cons (NULL_TREE, temp_type, NULL_TREE));
- protocol_type = build_pointer_type (xref_tag (RECORD_TYPE,
- temp_type));
+ objc_protocol_type = build_pointer_type (xref_tag (RECORD_TYPE, temp_type));


/* Declare type of selector-objects that represent an operation name. */

if (flag_next_runtime)
/* `struct objc_selector *' */
- selector_type
+ objc_selector_type
= build_pointer_type (xref_tag (RECORD_TYPE,
get_identifier (TAG_SELECTOR)));
else
/* `const struct objc_selector *' */
- selector_type
+ objc_selector_type
= build_pointer_type
(build_qualified_type (xref_tag (RECORD_TYPE,
get_identifier (TAG_SELECTOR)),
@@ -1168,8 +1172,8 @@
/* Declare receiver type used for dispatching messages to 'super'. */


   /* `struct objc_super *' */
-  super_type = build_pointer_type (xref_tag (RECORD_TYPE,
-					  get_identifier (TAG_SUPER)));
+  objc_super_type = build_pointer_type (xref_tag (RECORD_TYPE,
+						  get_identifier (TAG_SUPER)));

if (flag_next_runtime)
{
@@ -1183,9 +1187,10 @@
/* id objc_msgSend_stret (id, SEL, ...); */
/* id objc_msgSendNonNil_stret (id, SEL, ...); */
temp_type
- = build_function_type (id_type,
- tree_cons (NULL_TREE, id_type,
- tree_cons (NULL_TREE, selector_type,
+ = build_function_type (objc_id_type,
+ tree_cons (NULL_TREE, objc_id_type,
+ tree_cons (NULL_TREE,
+ objc_selector_type,
NULL_TREE)));
umsg_decl = builtin_function (TAG_MSGSEND,
temp_type, 0, NOT_BUILT_IN,
@@ -1203,9 +1208,10 @@
/* id objc_msgSendSuper (struct objc_super *, SEL, ...); */
/* id objc_msgSendSuper_stret (struct objc_super *, SEL, ...); */
temp_type
- = build_function_type (id_type,
- tree_cons (NULL_TREE, super_type,
- tree_cons (NULL_TREE, selector_type,
+ = build_function_type (objc_id_type,
+ tree_cons (NULL_TREE, objc_super_type,
+ tree_cons (NULL_TREE,
+ objc_selector_type,
NULL_TREE)));
umsg_super_decl = builtin_function (TAG_MSGSENDSUPER,
temp_type, 0, NOT_BUILT_IN,
@@ -1221,16 +1227,18 @@
/* typedef id (*IMP)(id, SEL, ...); */
tree IMP_type
= build_pointer_type
- (build_function_type (id_type,
- tree_cons (NULL_TREE, id_type,
- tree_cons (NULL_TREE, selector_type,
+ (build_function_type (objc_id_type,
+ tree_cons (NULL_TREE, objc_id_type,
+ tree_cons (NULL_TREE,
+ objc_selector_type,
NULL_TREE))));


/* IMP objc_msg_lookup (id, SEL); */
temp_type
= build_function_type (IMP_type,
- tree_cons (NULL_TREE, id_type,
- tree_cons (NULL_TREE, selector_type,
+ tree_cons (NULL_TREE, objc_id_type,
+ tree_cons (NULL_TREE,
+ objc_selector_type,
void_list_node)));
umsg_decl = builtin_function (TAG_MSGSEND,
temp_type, 0, NOT_BUILT_IN,
@@ -1239,8 +1247,9 @@
/* IMP objc_msg_lookup_super (struct objc_super *, SEL); */
temp_type
= build_function_type (IMP_type,
- tree_cons (NULL_TREE, super_type,
- tree_cons (NULL_TREE, selector_type,
+ tree_cons (NULL_TREE, objc_super_type,
+ tree_cons (NULL_TREE,
+ objc_selector_type,
void_list_node)));
umsg_super_decl = builtin_function (TAG_MSGSENDSUPER,
temp_type, 0, NOT_BUILT_IN,
@@ -1249,7 +1258,7 @@


/* id objc_getClass (const char *); */

-  temp_type = build_function_type (id_type,
+  temp_type = build_function_type (objc_id_type,
 				   tree_cons (NULL_TREE,
 					      const_string_type_node,
 					      void_list_node));
@@ -1288,7 +1297,7 @@
 	  debug_hooks = save_hooks;
 	}
       else
-	temp_type = build_array_type (selector_type, NULL_TREE);
+	temp_type = build_array_type (objc_selector_type, NULL_TREE);

       layout_type (temp_type);
       UOBJC_SELECTOR_TABLE_decl
@@ -1558,7 +1567,7 @@
   /* SEL *refs; */

   field_decl = create_builtin_decl (FIELD_DECL,
-				    build_pointer_type (selector_type),
+				    build_pointer_type (objc_selector_type),
 				    "refs");
   chainon (field_decl_chain, field_decl);

@@ -2086,7 +2095,7 @@

ident = get_identifier (buf);

-  decl = build_decl (VAR_DECL, ident, selector_type);
+  decl = build_decl (VAR_DECL, ident, objc_selector_type);
   DECL_EXTERNAL (decl) = 1;
   TREE_PUBLIC (decl) = 0;
   TREE_USED (decl) = 1;
@@ -2108,7 +2117,7 @@
   if (flag_typed_selectors)
     return expr;
   else
-    return build_c_cast (selector_type, expr); /* cast! */
+    return build_c_cast (objc_selector_type, expr); /* cast! */
 }

static void
@@ -2158,7 +2167,7 @@
sc_spec = build_tree_list (NULL_TREE, ridpointers[(int) RID_STATIC]);


 	  /* static SEL _OBJC_SELECTOR_REFERENCES_n = ...; */
-	  decl_specs = tree_cons (NULL_TREE, selector_type, sc_spec);
+	  decl_specs = tree_cons (NULL_TREE, objc_selector_type, sc_spec);

var_decl = name;

@@ -2249,7 +2258,7 @@
 			 build_array_ref (UOBJC_SELECTOR_TABLE_decl,
 					  build_int_2 (index, 0)),
 			 1);
-  return build_c_cast (selector_type, expr);
+  return build_c_cast (objc_selector_type, expr);
 }

 static tree
@@ -2558,8 +2567,8 @@
   if (!type || TREE_CODE (type) != POINTER_TYPE)
     return 0;
   /* NB: This function may be called before the ObjC front-end has
-     been initialized, in which case ID_TYPE will be NULL.  */
-  if (id_type && type && TYPE_P (type)
+     been initialized, in which case OBJC_ID_TYPE will be NULL.  */
+  if (objc_id_type && type && TYPE_P (type)
       && (IS_ID (type)
 	  || TREE_TYPE (type) == TREE_TYPE (objc_class_type)))
     return type;
@@ -2773,13 +2782,13 @@
       tree var = cur_try_context->caught_decl;
       if (!var)
 	{
-	  var = objc_create_temporary_var (id_type);
+	  var = objc_create_temporary_var (objc_id_type);
 	  cur_try_context->caught_decl = var;
 	}
       return var;
     }
   else
-    return build (EXC_PTR_EXPR, id_type);
+    return build (EXC_PTR_EXPR, objc_id_type);
 }

 /* Build "objc_exception_try_exit(&_stack)".  */
@@ -2959,7 +2968,7 @@
   stack_decl = objc_create_temporary_var (t);
   cur_try_context->stack_decl = stack_decl;

-  rethrow_decl = objc_create_temporary_var (id_type);
+  rethrow_decl = objc_create_temporary_var (objc_id_type);
   cur_try_context->rethrow_decl = rethrow_decl;
   TREE_THIS_VOLATILE (rethrow_decl) = 1;
   TREE_CHAIN (rethrow_decl) = stack_decl;
@@ -2971,7 +2980,7 @@

   /* Initialize rethrow_decl.  */
   t = build (MODIFY_EXPR, void_type_node, rethrow_decl,
-	     convert (id_type, null_pointer_node));
+	     convert (objc_id_type, null_pointer_node));
   annotate_with_locus (t, cur_try_context->try_locus);
   append_to_statement_list (t, &BIND_EXPR_BODY (bind));

@@ -3091,7 +3100,7 @@
 	      warning ("exception of type %<%T%> will be caught",
 		       TREE_TYPE (type));
 	      warning ("%H   by earlier handler for %<%T%>",
-		       EXPR_LOCUS (stmt), TREE_TYPE (t ? t : id_type));
+		       EXPR_LOCUS (stmt), TREE_TYPE (t ? t : objc_id_type));
 	      break;
 	    }
 	}
@@ -3291,7 +3300,7 @@

/* id objc_exception_extract(struct _objc_exception_data *); */
temp_type
- = build_function_type (id_type,
+ = build_function_type (objc_id_type,
tree_cons (NULL_TREE,
build_pointer_type (objc_exception_data_template),
void_list_node));
@@ -3310,10 +3319,11 @@
= builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);


/* int objc_exception_match(id, id); */
- temp_type = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, id_type,
- tree_cons (NULL_TREE, id_type,
- void_list_node)));
+ temp_type
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, objc_id_type,
+ tree_cons (NULL_TREE, objc_id_type,
+ void_list_node)));
objc_exception_match_decl
= builtin_function (TAG_EXCEPTIONMATCH, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);

@@ -3333,7 +3343,7 @@
/* void objc_sync_enter(id); */
/* void objc_sync_exit(id); */
temp_type = build_function_type (void_type_node,
- tree_cons (NULL_TREE, id_type,
+ tree_cons (NULL_TREE, objc_id_type,
void_list_node));
objc_exception_throw_decl
= builtin_function (TAG_EXCEPTIONTHROW, temp_type, 0, NOT_BUILT_IN, NULL,
@@ -3375,7 +3385,7 @@
TREE_STATIC_TEMPLATE (uprivate_record) = 1;
}


-  instance_type
+  objc_instance_type
     = groktypename (build_tree_list (build_tree_list (NULL_TREE,
 						      uprivate_record),
 				     build1 (INDIRECT_REF, NULL_TREE,
@@ -5416,14 +5426,14 @@

   /* Receiver type.  */
   if (flag_next_runtime && superflag)
-    arglist = build_tree_list (NULL_TREE, super_type);
+    arglist = build_tree_list (NULL_TREE, objc_super_type);
   else if (context == METHOD_DEF)
     arglist = build_tree_list (NULL_TREE, TREE_TYPE (self_decl));
   else
-    arglist = build_tree_list (NULL_TREE, id_type);
+    arglist = build_tree_list (NULL_TREE, objc_id_type);

   /* Selector type - will eventually change to `int'.  */
-  chainon (arglist, build_tree_list (NULL_TREE, selector_type));
+  chainon (arglist, build_tree_list (NULL_TREE, objc_selector_type));

/* No actual method prototype given -- assume that remaining arguments
are `...'. */
@@ -5652,7 +5662,7 @@
finish_message_expr (tree receiver, tree sel_name, tree method_params)
{
tree method_prototype = NULL_TREE, rprotos = NULL_TREE, rtype;
- tree selector, retval, is_class;
+ tree selector, retval, class_tree;
int self, super, have_cast;


   /* Extract the receiver of the message, as well as its type
@@ -5673,14 +5683,14 @@

   /* If the receiver is a class object, retrieve the corresponding
      @interface, if one exists. */
-  is_class = receiver_is_class_object (receiver, self, super);
+  class_tree = receiver_is_class_object (receiver, self, super);

   /* Now determine the receiver type (if an explicit cast has not been
      provided).  */
   if (!have_cast)
     {
-      if (is_class)
-	rtype = lookup_interface (is_class);
+      if (class_tree)
+	rtype = lookup_interface (class_tree);
       /* Handle `self' and `super'.  */
       else if (super)
 	{
@@ -5703,23 +5713,23 @@
 	|| TREE_TYPE (rtype) == TREE_TYPE (objc_class_type))
     {
       if (!rtype)
-	rtype = xref_tag (RECORD_TYPE, is_class);
+	rtype = xref_tag (RECORD_TYPE, class_tree);
       else if (IS_ID (rtype))
 	{
 	  rprotos = TYPE_PROTOCOL_LIST (rtype);
 	  rtype = NULL_TREE;
 	}
       else
-	is_class = TYPE_NAME (rtype) = get_identifier ("Class");
+	class_tree = TYPE_NAME (rtype) = get_identifier ("Class");

if (rprotos)
method_prototype
= lookup_method_in_protocol_list (rprotos, sel_name,
- is_class != NULL_TREE);
+ class_tree != NULL_TREE);
if (!method_prototype && !rprotos)
method_prototype
= lookup_method_in_hash_lists (sel_name,
- is_class != NULL_TREE);
+ class_tree != NULL_TREE);
}
else
{
@@ -5751,7 +5761,7 @@
in the published @interface for the class (and its
superclasses). */
method_prototype
- = lookup_method_static (rtype, sel_name, is_class != NULL_TREE);
+ = lookup_method_static (rtype, sel_name, class_tree != NULL_TREE);


 	  /* If the method was not found in the @interface, it may still
 	     exist locally as part of the @implementation.  */
@@ -5760,7 +5770,7 @@
 		== OBJC_TYPE_NAME (rtype))			
 	    method_prototype
 	      = lookup_method
-		((is_class
+		((class_tree
 		  ? CLASS_CLS_METHODS (objc_implementation_context)
 		  : CLASS_NST_METHODS (objc_implementation_context)),
 		  sel_name);
@@ -5770,7 +5780,7 @@
 	  if (!method_prototype && rprotos)
 	    method_prototype
 	      = lookup_method_in_protocol_list (rprotos, sel_name,
-						is_class != NULL_TREE);
+						class_tree != NULL_TREE);
 	}
       else
 	{
@@ -5787,11 +5797,11 @@
       if (rtype)
 	warning ("`%s' may not respond to `%c%s'",
 		 IDENTIFIER_POINTER (OBJC_TYPE_NAME (rtype)),
-		 (is_class ? '+' : '-'),
+		 (class_tree ? '+' : '-'),
 		 IDENTIFIER_POINTER (sel_name));
       if (rprotos)
 	warning ("`%c%s' not implemented by protocol(s)",
-		 (is_class ? '+' : '-'),
+		 (class_tree ? '+' : '-'),
 		 IDENTIFIER_POINTER (sel_name));
       if (!warn_missing_methods)
 	{
@@ -5838,7 +5848,7 @@
 		 (!flag_next_runtime || flag_nil_receivers
 		  ? umsg_decl
 		  : umsg_nonnil_decl));
-  tree rcv_p = (super_flag ? super_type : id_type);
+  tree rcv_p = (super_flag ? objc_super_type : objc_id_type);

/* If a prototype for the method to be called exists, then cast
the sender's return type and arguments to match that of the method.
@@ -5846,7 +5856,7 @@
tree ret_type
= (method_prototype
? groktypename (TREE_TYPE (method_prototype))
- : id_type);
+ : objc_id_type);
tree sender_cast
= build_pointer_type
(build_function_type
@@ -5957,9 +5967,9 @@


expr = build_unary_op (ADDR_EXPR, PROTOCOL_FORWARD_DECL (p), 0);

- /* ??? Ideally we'd build the reference with protocol_type directly,
+ /* ??? Ideally we'd build the reference with objc_protocol_type directly,
if we have it, rather than converting it here. */
- expr = convert (protocol_type, expr);
+ expr = convert (objc_protocol_type, expr);


/* The @protocol() expression is being compiled into a pointer to a
statically allocated instance of the Protocol class. To become
@@ -5977,7 +5987,7 @@
if (! flag_next_runtime)
{
/* This type is a struct containing the fields of a Protocol
- object. (Cfr. protocol_type instead is the type of a pointer
+ object. (Cfr. objc_protocol_type instead is the type of a pointer
to such a struct). */
tree protocol_struct_type = xref_tag
(RECORD_TYPE, get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
@@ -6090,7 +6100,7 @@
paradigm. */
warning ("instance variable `%s' accessed in class method",
IDENTIFIER_POINTER (id));
- TREE_TYPE (self_decl) = instance_type; /* cast */
+ TREE_TYPE (self_decl) = objc_instance_type; /* cast */
}


return build_component_ref (build_indirect_ref (self_decl, "->"), id);
@@ -7500,7 +7510,7 @@
build1 (INDIRECT_REF, NULL_TREE, self_id)),
unused_list));


- decl_specs = build_tree_list (NULL_TREE, TREE_TYPE (selector_type));
+ decl_specs = build_tree_list (NULL_TREE, TREE_TYPE (objc_selector_type));
push_parm_decl (build_tree_list
(build_tree_list (decl_specs,
build1 (INDIRECT_REF, NULL_TREE, ucmd_id)),
Index: gcc/objc/objc-act.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.h,v
retrieving revision 1.23
diff -u -r1.23 objc-act.h
--- gcc/objc/objc-act.h 18 Jun 2004 01:20:52 -0000 1.23
+++ gcc/objc/objc-act.h 19 Jun 2004 10:29:08 -0000
@@ -57,7 +57,7 @@
tree get_class_ivars_from_name (tree);
tree get_class_reference (tree);
tree get_static_reference (tree, tree);
-tree get_object_reference (tree);
+tree get_protocol_reference (tree);
tree build_message_expr (tree);
tree finish_message_expr (tree, tree, tree);
tree build_selector_expr (tree);
@@ -308,17 +308,17 @@
#define objc_get_meta_class_decl \
objc_global_trees[OCTI_GET_MCLASS_DECL]


-#define super_type		objc_global_trees[OCTI_SUPER_TYPE]
-#define selector_type		objc_global_trees[OCTI_SEL_TYPE]
-#define id_type			objc_global_trees[OCTI_ID_TYPE]
+#define objc_super_type		objc_global_trees[OCTI_SUPER_TYPE]
+#define objc_selector_type	objc_global_trees[OCTI_SEL_TYPE]
+#define objc_id_type		objc_global_trees[OCTI_ID_TYPE]
 #define objc_class_type		objc_global_trees[OCTI_CLS_TYPE]
-#define instance_type		objc_global_trees[OCTI_NST_TYPE]
-#define protocol_type		objc_global_trees[OCTI_PROTO_TYPE]
+#define objc_instance_type	objc_global_trees[OCTI_NST_TYPE]
+#define objc_protocol_type	objc_global_trees[OCTI_PROTO_TYPE]

/* Type checking macros. */

 #define IS_ID(TYPE) \
-  (TYPE_MAIN_VARIANT (TYPE) == TYPE_MAIN_VARIANT (id_type))
+  (TYPE_MAIN_VARIANT (TYPE) == TYPE_MAIN_VARIANT (objc_id_type))
 #define IS_PROTOCOL_QUALIFIED_ID(TYPE) \
   (IS_ID (TYPE) && TYPE_PROTOCOL_LIST (TYPE))
 #define IS_SUPER(TYPE) \
Index: gcc/objc/objc-tree.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-tree.def,v
retrieving revision 1.8
diff -u -r1.8 objc-tree.def
--- gcc/objc/objc-tree.def	25 Sep 2003 01:25:53 -0000	1.8
+++ gcc/objc/objc-tree.def	19 Jun 2004 10:29:08 -0000
@@ -37,3 +37,9 @@
 /* Objective-C expressions.  */
 DEFTREECODE (MESSAGE_SEND_EXPR, "message_send_expr", 'e', 3)
 DEFTREECODE (CLASS_REFERENCE_EXPR, "class_reference_expr", 'e', 1)
+
+/*
+Local variables:
+mode:c
+End:
+*/


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