diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-14 21:35:37 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-14 21:35:37 +0000 |
commit | c6595ab558f2f03f9bcb82d630b4ca5967b6c34b (patch) | |
tree | 8b6abbcde0d4773318291e31a4e7d3d8da247b35 /gcc/objc | |
parent | 59b4cc29d4e44c8874d0772f2b7a46a814f143ea (diff) | |
download | gcc-c6595ab558f2f03f9bcb82d630b4ca5967b6c34b.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69364 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/objc-act.c | 4 | ||||
-rw-r--r-- | gcc/objc/objc-act.h | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index f7f07f9d102..f84d9f202a4 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -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 diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h index c06c2b8c271..94c7015395c 100644 --- a/gcc/objc/objc-act.h +++ b/gcc/objc/objc-act.h @@ -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'. */ |