aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.h
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2003-07-14 21:35:37 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2003-07-14 21:35:37 +0000
commit18009d039eecc8f44b6993fa24997c99178cee5e (patch)
tree8b6abbcde0d4773318291e31a4e7d3d8da247b35 /gcc/objc/objc-act.h
parent8d83f79225703195e325dba0138432382e4dfab0 (diff)
downloadgcc-18009d039eecc8f44b6993fa24997c99178cee5e.zip
gcc-18009d039eecc8f44b6993fa24997c99178cee5e.tar.gz
gcc-18009d039eecc8f44b6993fa24997c99178cee5e.tar.bz2
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
Diffstat (limited to 'gcc/objc/objc-act.h')
-rw-r--r--gcc/objc/objc-act.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h
index c06c2b8..94c7015 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'. */