Commit 2fb31127 by Tom Wood

Add support for protocols, classes, and strings.

Add support for protocols, classes, and
	strings.  Update the runtime targets for the new GNU runtimes as
	well as existing NeXT runtimes.

From-SVN: r4069
parent e31c7eec
...@@ -20,53 +20,54 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -20,53 +20,54 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*** Public Interface (procedures) ***/ /*** Public Interface (procedures) ***/
/* used by compile_file */
void init_objc (), finish_objc ();
/* used by yyparse */ /* used by yyparse */
tree start_class (); void objc_finish PROTO((void));
tree continue_class (); tree start_class PROTO((enum tree_code, tree, tree, tree));
void finish_class (); tree continue_class PROTO((tree));
void start_method_def (); void finish_class PROTO((tree));
void continue_method_def (); void start_method_def PROTO((tree));
void finish_method_def (); void continue_method_def PROTO((void));
void add_objc_decls (); void finish_method_def PROTO((void));
tree start_protocol PROTO((enum tree_code, tree, tree));
tree is_ivar (); void finish_protocol PROTO((tree));
int is_public (); void add_objc_decls PROTO((void));
tree add_instance_variable ();
tree add_class_method (); tree is_ivar PROTO((tree, tree));
tree add_instance_method (); int is_private PROTO((tree));
tree get_super_receiver (); int is_public PROTO((tree, tree));
tree get_class_ivars (); tree add_instance_variable PROTO((tree, int, tree, tree, tree));
tree get_class_reference (); tree add_class_method PROTO((tree, tree));
tree get_static_reference (); tree add_instance_method PROTO((tree, tree));
tree get_super_receiver PROTO((void));
tree build_message_expr (); tree get_class_ivars PROTO((tree));
tree build_selector_expr (); tree get_class_reference PROTO((tree));
tree build_ivar_reference (); tree get_static_reference PROTO((tree, tree));
tree build_keyword_decl (); tree get_object_reference PROTO((tree));
tree build_method_decl (); tree build_message_expr PROTO((tree));
tree build_selector_expr PROTO((tree));
/* Nonzero enables objc features. */ tree build_ivar_reference PROTO((tree));
tree build_keyword_decl PROTO((tree, tree, tree));
extern int doing_objc_thang; tree build_method_decl PROTO((enum tree_code, tree, tree, tree));
tree build_protocol_expr PROTO((tree));
tree build_objc_string_object PROTO((tree));
extern tree objc_ivar_chain;
extern tree objc_method_context;
void objc_declare_alias PROTO((tree, tree));
void objc_declare_class PROTO((tree));
extern int objc_receiver_context;
/* the following routines are used to implement statically typed objects */ /* the following routines are used to implement statically typed objects */
tree lookup_interface (); int objc_comptypes PROTO((tree, tree, int));
int objc_comptypes (); void objc_check_decl PROTO((tree));
void objc_check_decl ();
/* NeXT extensions */ /* NeXT extensions */
tree build_encode_expr (); tree build_encode_expr PROTO((tree));
/* used by rest_of_compilation. */
void genPrototype ();
/* Objective-C structures */ /* Objective-C structures */
...@@ -81,21 +82,34 @@ void genPrototype (); ...@@ -81,21 +82,34 @@ void genPrototype ();
#define METHOD_DEFINITION(DECL) ((DECL)->decl.initial) #define METHOD_DEFINITION(DECL) ((DECL)->decl.initial)
#define METHOD_ENCODING(DECL) ((DECL)->decl.context) #define METHOD_ENCODING(DECL) ((DECL)->decl.context)
/* INTERFACE_TYPE, IMPLEMENTATION_TYPE, CATEGORY_TYPE */ /* CLASS_INTERFACE_TYPE, CLASS_IMPLEMENTATION_TYPE,
CATEGORY_INTERFACE_TYPE, CATEGORY_IMPLEMENTATION_TYPE,
PROTOCOL_INTERFACE_TYPE */
#define CLASS_NAME(CLASS) ((CLASS)->type.name) #define CLASS_NAME(CLASS) ((CLASS)->type.name)
#define CLASS_SUPER_NAME(CLASS) ((CLASS)->type.binfo) #define CLASS_SUPER_NAME(CLASS) ((CLASS)->type.context)
#define CLASS_IVARS(CLASS) ((CLASS)->type.maxval) #define CLASS_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 0)
#define CLASS_RAW_IVARS(CLASS) ((CLASS)->type.noncopied_parts) #define CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 1)
#define CLASS_NST_METHODS(CLASS) ((CLASS)->type.next_variant) #define CLASS_NST_METHODS(CLASS) ((CLASS)->type.minval)
#define CLASS_CLS_METHODS(CLASS) ((CLASS)->type.main_variant) #define CLASS_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
#define CLASS_STATIC_TEMPLATE(CLASS) ((CLASS)->type.context) #define CLASS_STATIC_TEMPLATE(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 2)
#define CLASS_CATEGORY_LIST(CLASS) ((CLASS)->type.minval) #define CLASS_CATEGORY_LIST(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 3)
#define CLASS_PROTOCOL_LIST(CLASS) ((CLASS)->type.noncopied_parts)
/* Define the Objective-C language-specific tree codes. */ #define PROTOCOL_NAME(CLASS) ((CLASS)->type.name)
#define PROTOCOL_LIST(CLASS) ((CLASS)->type.binfo)
#define PROTOCOL_NST_METHODS(CLASS) ((CLASS)->type.minval)
#define PROTOCOL_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
#define PROTOCOL_FORWARD_DECL(CLASS) ((CLASS)->type.context)
#define TYPE_PROTOCOL_LIST(TYPE) ((TYPE)->type.noncopied_parts)
/* Define the Objective-C or Objective-C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum objc_tree_code { enum objc_tree_code {
#ifdef OBJCPLUS
dummy_tree_code = LAST_CPLUS_TREE_CODE,
#else
dummy_tree_code = LAST_AND_UNUSED_TREE_CODE, dummy_tree_code = LAST_AND_UNUSED_TREE_CODE,
#endif
#include "objc-tree.def" #include "objc-tree.def"
LAST_OBJC_TREE_CODE LAST_OBJC_TREE_CODE
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment