objc-act.h (CLASS_SUPER_NAME): Add a little typechecking.

* objc/objc-act.h (CLASS_SUPER_NAME): Add a little typechecking.
	(TYPE_PROTOCOL_LIST): Share use of type.context with C frontend.
	(SET_TYPE_PROTOCOL_LIST): New.
	* objc/objc-act.c (get_static_reference): Use SET_TYPE_PROTOCOL_LIST.
	(get_object_reference): Likewise.

From-SVN: r69364
This commit is contained in:
Geoffrey Keating 2003-07-14 21:35:37 +00:00 committed by Geoffrey Keating
parent 8d83f79225
commit 18009d039e
3 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2003-07-14 Geoffrey Keating <geoffk@apple.com>
* objc/objc-act.h (CLASS_SUPER_NAME): Add a little typechecking.
(TYPE_PROTOCOL_LIST): Share use of type.context with C frontend.
(SET_TYPE_PROTOCOL_LIST): New.
* objc/objc-act.c (get_static_reference): Use SET_TYPE_PROTOCOL_LIST.
(get_object_reference): Likewise.
Mon Jul 14 23:14:28 CEST 2003 Jan Hubicka <jh@suse.cz>
* cfglayout.c (locator_file): Break out from ....

View File

@ -939,7 +939,7 @@ get_static_reference (interface, protocols)
/* Look up protocols and install in lang specific list. Note
that the protocol list can have a different lifetime than T! */
TYPE_PROTOCOL_LIST (t) = lookup_and_install_protocols (protocols);
SET_TYPE_PROTOCOL_LIST (t, lookup_and_install_protocols (protocols));
/* This forces a new pointer type to be created later
(in build_pointer_type)...so that the new template
@ -988,7 +988,7 @@ get_object_reference (protocols)
TYPE_NEXT_VARIANT (m) = t;
/* Look up protocols...and install in lang specific list */
TYPE_PROTOCOL_LIST (t) = lookup_and_install_protocols (protocols);
SET_TYPE_PROTOCOL_LIST (t, lookup_and_install_protocols (protocols));
/* This forces a new pointer type to be created later
(in build_pointer_type)...so that the new template

View File

@ -90,7 +90,7 @@ tree build_encode_expr PARAMS ((tree));
CATEGORY_INTERFACE_TYPE, CATEGORY_IMPLEMENTATION_TYPE,
PROTOCOL_INTERFACE_TYPE */
#define CLASS_NAME(CLASS) ((CLASS)->type.name)
#define CLASS_SUPER_NAME(CLASS) ((CLASS)->type.context)
#define CLASS_SUPER_NAME(CLASS) (TYPE_CHECK (CLASS)->type.context)
#define CLASS_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 0)
#define CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 1)
#define CLASS_NST_METHODS(CLASS) ((CLASS)->type.minval)
@ -105,7 +105,11 @@ tree build_encode_expr PARAMS ((tree));
#define PROTOCOL_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
#define PROTOCOL_FORWARD_DECL(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 1)
#define PROTOCOL_DEFINED(CLASS) TREE_USED (CLASS)
#define TYPE_PROTOCOL_LIST(TYPE) ((TYPE)->type.context)
#define TYPE_PROTOCOL_LIST(TYPE) \
((!TYPE_CHECK (TYPE)->type.context \
|| TREE_CODE ((TYPE)->type.context) == TRANSLATION_UNIT_DECL) \
? NULL_TREE : (TYPE)->type.context)
#define SET_TYPE_PROTOCOL_LIST(TYPE, P) (TYPE_CHECK (TYPE)->type.context = (P))
/* Set by `continue_class' and checked by `is_public'. */