diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-17 20:07:08 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-17 20:07:08 +0000 |
commit | 0ced0389c95a9b5af0ac18148d00d75e35849019 (patch) | |
tree | 5c27e283cf816aa99e92251fc2f107d93a66e0c8 /gcc/objc/objc-act.h | |
parent | 3a1918137f339ad2b99671566af7cbd570392bf5 (diff) | |
download | gcc-0ced0389c95a9b5af0ac18148d00d75e35849019.tar.gz |
Yet more Objective-C++...
* objc-act.c (objc_finish_try_stmt): Add return value.
(objc_build_synchronized): Likewise.
* objc-act.c (objc_is_gcable_type): Add.
(objc_substitute_decl): Add.
(objc_build_ivar_assignment): Add.
(objc_build_global_assignment): Add.
(objc_build_strong_cast_assignment): Add.
(objc_is_ivar_reference_p): Add.
(objc_is_global_reference_p): Add.
(objc_generate_write_barrier): Add.
(objc_rewrite_function_call): Add.
(objc_gimplify_expr): Add Objective-C++ support.
* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise.
(SIZEOF_OBJC_TYPE_LANG_SPECIFIC): Add.
(INIT_TYPE_OBJC_INFO): Add Objective-C++ support.
(DUP_TYPE_OBJC_INFO): Likewise.
(struct imp_entry): Add field has_cxx_cdtors.
(struct imp_entry *imp_list): Add OCTI_UMSG_FAST_DECL,
OCTI_METH_LIST_TEMPL, OCTI_METH_PROTO_LIST_TEMPL,
OCTI_IVAR_LIST_TEMPL, OCTI_ASSIGN_IVAR_DECL,
OCTI_ASSIGN_IVAR_FAST_DECL, OCTI_ASSIGN_GLOBAL_DECL,
OCTI_ASSIGN_STRONGCAST_DECL.
(umsg_fast_decl): Add.
(objc_assign_ivar_decl): Add.
(objc_assign_ivar_fast_decl): Add.
(objc_assign_global_decl): Add.
(objc_assign_strong_cast_decl): Add.
(objc_method_list_ptr): Add.
(objc_method_proto_list_ptr): Add.
(objc_ivar_list_ptr): Add.
* objc-act.c (should_call_super_dealloc): Add.
(OBJC_VERSION): Bump to 6.
(objc_is_gcable_type): Add.
(objc_substitute_decl): Add.
(objc_build_ivar_assignment): Add.
(objc_build_global_assignment): Add.
(objc_build_strong_cast_assignment): Add.
(objc_is_gcable_p): Add.
(objc_is_ivar_reference_p): Add.
(objc_is_global_reference_p): Add.
(generate_shared_structures): Add flags parameter.
(objc_generate_cxx_ctor_or_dtor): Add.
(objc_generate_cxx_cdtors): Add.
(add_class): Add name parameter.
(objc_types_share_size_and_alignment): Add.
(comp_proto_with_proto): Add strict parameter.
(CLS_HAS_CXX_STRUCTORS): Add.
(TAG_ASSIGNIVAR): Add.
(TAG_ASSIGNGLOBAL): Add.
(TAG_ASSIGNSTRONGCAST): Add.
(TAG_MSGSEND_FAST): Add.
(TAG_ASSIGNIVAR_FAST): Add.
(TAG_CXX_CONSTRUCT): Add.
(TAG_CXX_DESTRUCT): Add.
(OBJC_LOOKUP_CLASS): Add.
(OBJC_LOOKUP_NO_SUPER): Add.
(objc_finish_file): Add pch support.
(objc_finish_implementation): Add Objective-C++ support.
(synth_module_prologue): Likewise.
(synth_module_prologue): Add fast dispatching.
(objc_get_class_reference): Add Objective-C++ support.
(objc_generate_write_barrier): Likewise.
(next_sjlj_build_enter_and_setjmp): Likewise.
(objc_begin_try_stmt): Likewise.
(build_next_objc_exception_stuff): Add fast ivar support.
(build_private_template): Mark the record as used so debug
information is generated.
(build_protocol_template): Add Objective-C++ support.
(objc_method_parm_type) Likewise.
(objc_generate_cxx_ctor_or_dtor): Likewise.
(objc_generate_cxx_cdtors): Likewise.
(build_protocol_initializer): Likewise.
(build_category_template): Likewise.
(build_class_template): Likewise.
(build_method_list_template): Likewise.
(build_category_initializer): Likewise.
(build_shared_structure_initializer): Likewise.
(objc_finish_message_expr): Likewise.
(build_objc_method_call): Add fast dispatch support.
(lookup_method_static): Add support to end search at superclasses.
(add_method_to_hash_list): Add strict parameter to
comp_proto_with_proto.
(objc_add_method): Likewise.
(objc_add_method): Also set the interface_value.
(add_instance_variable): Add Objective-C++ support.
(objc_is_public): Likewise.
(start_class): Likewise.
(continue_class): Likewise.
(encode_aggregate_within): Likewise.
(start_method_def): Likewise.
(objc_start_function): Clear current_function_returns_value
and current_function_returns_null.
(really_start_method): Add Objective-C++ support.
(objc_finish_method_definition): Add warning for missing
[super dealloc].
(finish_objc): Add Objective-C++ support.
(generate_objc_image_info): Likewise.
(objc_lookup_ivar): Likewise.
* objc-act.h (TYPE_HAS_OBJC_INFO): Likewise.
(INIT_TYPE_OBJC_INFO): Likewise.
(DUP_TYPE_OBJC_INFO): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc/objc-act.h')
-rw-r--r-- | gcc/objc/objc-act.h | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h index fe84260e4b5..47ee83ed5e3 100644 --- a/gcc/objc/objc-act.h +++ b/gcc/objc/objc-act.h @@ -77,43 +77,45 @@ enum gimplify_status objc_gimplify_expr (tree *, tree *, tree *); /* ObjC-specific information pertaining to RECORD_TYPEs are stored in the LANG_SPECIFIC structures, which may itself need allocating first. */ + +/* The following three macros must be overridden (in objcp/objcp-decl.h) + for Objective-C++. */ #define TYPE_OBJC_INFO(TYPE) TYPE_LANG_SPECIFIC (TYPE)->objc_info +#define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type) +#define ALLOC_OBJC_TYPE_LANG_SPECIFIC(NODE) \ + do { \ + TYPE_LANG_SPECIFIC (NODE) = GGC_CNEW (struct lang_type); \ + } while (0) + #define TYPE_HAS_OBJC_INFO(TYPE) \ - (TYPE_LANG_SPECIFIC (TYPE) \ - && TYPE_LANG_SPECIFIC (TYPE)->objc_info) + (TYPE_LANG_SPECIFIC (TYPE) && TYPE_OBJC_INFO (TYPE)) #define TYPE_OBJC_INTERFACE(TYPE) TREE_VEC_ELT (TYPE_OBJC_INFO (TYPE), 0) #define TYPE_OBJC_PROTOCOL_LIST(TYPE) TREE_VEC_ELT (TYPE_OBJC_INFO (TYPE), 1) + #define INIT_TYPE_OBJC_INFO(TYPE) \ do \ { \ if (!TYPE_LANG_SPECIFIC (TYPE)) \ - TYPE_LANG_SPECIFIC (TYPE) \ - = ALLOC_OBJC_TYPE_LANG_SPECIFIC; \ - if (!TYPE_LANG_SPECIFIC (TYPE)->objc_info) \ - TYPE_LANG_SPECIFIC (TYPE)->objc_info \ + ALLOC_OBJC_TYPE_LANG_SPECIFIC(TYPE); \ + if (!TYPE_OBJC_INFO (TYPE)) \ + TYPE_OBJC_INFO (TYPE) \ = make_tree_vec (OBJC_INFO_SLOT_ELTS); \ } \ while (0) #define DUP_TYPE_OBJC_INFO(DST, SRC) \ do \ { \ - TYPE_LANG_SPECIFIC (DST) \ - = ALLOC_OBJC_TYPE_LANG_SPECIFIC; \ + ALLOC_OBJC_TYPE_LANG_SPECIFIC(DST); \ if (TYPE_LANG_SPECIFIC (SRC)) \ memcpy (TYPE_LANG_SPECIFIC (DST), \ TYPE_LANG_SPECIFIC (SRC), \ SIZEOF_OBJC_TYPE_LANG_SPECIFIC); \ - TYPE_LANG_SPECIFIC (DST)->objc_info \ + TYPE_OBJC_INFO (DST) \ = make_tree_vec (OBJC_INFO_SLOT_ELTS); \ } \ while (0) -/* The following two macros must be overridden (in objcp/objcp-decl.h) - for Objective-C++. */ -#define ALLOC_OBJC_TYPE_LANG_SPECIFIC GGC_CNEW (struct lang_type) -#define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type) - #define TYPED_OBJECT(TYPE) \ (TREE_CODE (TYPE) == RECORD_TYPE \ && TYPE_HAS_OBJC_INFO (TYPE) \ @@ -170,6 +172,7 @@ struct imp_entry GTY(()) tree imp_template; tree class_decl; /* _OBJC_CLASS_<my_name>; */ tree meta_decl; /* _OBJC_METACLASS_<my_name>; */ + BOOL_BITFIELD has_cxx_cdtors : 1; }; extern GTY(()) struct imp_entry *imp_list; @@ -191,6 +194,7 @@ enum objc_tree_index OCTI_SELF_DECL, OCTI_UMSG_DECL, + OCTI_UMSG_FAST_DECL, OCTI_UMSG_SUPER_DECL, OCTI_UMSG_STRET_DECL, OCTI_UMSG_SUPER_STRET_DECL, @@ -241,6 +245,9 @@ enum objc_tree_index OCTI_UUCLS_SUPER_REF, OCTI_METH_TEMPL, OCTI_IVAR_TEMPL, + OCTI_METH_LIST_TEMPL, + OCTI_METH_PROTO_LIST_TEMPL, + OCTI_IVAR_LIST_TEMPL, OCTI_SYMTAB_TEMPL, OCTI_MODULE_TEMPL, OCTI_SUPER_TEMPL, @@ -278,6 +285,11 @@ enum objc_tree_index OCTI_CATCH_TYPE, OCTI_EXECCLASS_DECL, + OCTI_ASSIGN_IVAR_DECL, + OCTI_ASSIGN_IVAR_FAST_DECL, + OCTI_ASSIGN_GLOBAL_DECL, + OCTI_ASSIGN_STRONGCAST_DECL, + OCTI_MAX }; @@ -297,6 +309,7 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX]; #define self_decl objc_global_trees[OCTI_SELF_DECL] #define umsg_decl objc_global_trees[OCTI_UMSG_DECL] +#define umsg_fast_decl objc_global_trees[OCTI_UMSG_FAST_DECL] #define umsg_super_decl objc_global_trees[OCTI_UMSG_SUPER_DECL] #define umsg_stret_decl objc_global_trees[OCTI_UMSG_STRET_DECL] #define umsg_super_stret_decl objc_global_trees[OCTI_UMSG_SUPER_STRET_DECL] @@ -408,8 +421,19 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX]; #define execclass_decl objc_global_trees[OCTI_EXECCLASS_DECL] +#define objc_assign_ivar_decl objc_global_trees[OCTI_ASSIGN_IVAR_DECL] +#define objc_assign_ivar_fast_decl \ + objc_global_trees[OCTI_ASSIGN_IVAR_FAST_DECL] +#define objc_assign_global_decl objc_global_trees[OCTI_ASSIGN_GLOBAL_DECL] +#define objc_assign_strong_cast_decl \ + objc_global_trees[OCTI_ASSIGN_STRONGCAST_DECL] + #define objc_method_template objc_global_trees[OCTI_METH_TEMPL] #define objc_ivar_template objc_global_trees[OCTI_IVAR_TEMPL] +#define objc_method_list_ptr objc_global_trees[OCTI_METH_LIST_TEMPL] +#define objc_method_proto_list_ptr \ + objc_global_trees[OCTI_METH_PROTO_LIST_TEMPL] +#define objc_ivar_list_ptr objc_global_trees[OCTI_IVAR_LIST_TEMPL] #define objc_symtab_template objc_global_trees[OCTI_SYMTAB_TEMPL] #define objc_module_template objc_global_trees[OCTI_MODULE_TEMPL] #define objc_super_template objc_global_trees[OCTI_SUPER_TEMPL] |