* objc/objc-act.c: Apply various cosmetic and formatting changes.
From-SVN: r48365
This commit is contained in:
parent
7f3ad6b697
commit
ad074d60dd
|
@ -1,3 +1,7 @@
|
|||
2001-12-29 Stan Shebs <shebs@apple.com>
|
||||
|
||||
* objc/objc-act.c: Apply various cosmetic and formatting changes.
|
||||
|
||||
2001-12-29 Kazu Hirata <kazu@hxi.com>
|
||||
|
||||
* config/rs6000/darwin-tramp.asm: Fix comment formatting.
|
||||
|
|
|
@ -382,7 +382,7 @@ static const char *TAG_MSGSEND;
|
|||
static const char *TAG_MSGSENDSUPER;
|
||||
static const char *TAG_EXECCLASS;
|
||||
|
||||
/* The OCTI_... enumeration itself in in objc/objc-act.h. */
|
||||
/* The OCTI_... enumeration itself is in objc/objc-act.h. */
|
||||
tree objc_global_trees[OCTI_MAX];
|
||||
|
||||
int objc_receiver_context;
|
||||
|
@ -437,20 +437,19 @@ int flag_warn_protocol = 1;
|
|||
/* Tells "encode_pointer/encode_aggregate" whether we are generating
|
||||
type descriptors for instance variables (as opposed to methods).
|
||||
Type descriptors for instance variables contain more information
|
||||
than methods (for static typing and embedded structures). This
|
||||
was added to support features being planned for dbkit2. */
|
||||
than methods (for static typing and embedded structures). */
|
||||
|
||||
static int generating_instance_variables = 0;
|
||||
|
||||
/* Tells the compiler that this is a special run. Do not perform
|
||||
any compiling, instead we are to test some platform dependent
|
||||
features and output a C header file with appropriate definitions. */
|
||||
/* Tells the compiler that this is a special run. Do not perform any
|
||||
compiling, instead we are to test some platform dependent features
|
||||
and output a C header file with appropriate definitions. */
|
||||
|
||||
static int print_struct_values = 0;
|
||||
|
||||
/* Some platforms pass small structures through registers versus through
|
||||
an invisible pointer. Determine at what size structure is the
|
||||
transition point between the two possibilities. */
|
||||
/* Some platforms pass small structures through registers versus
|
||||
through an invisible pointer. Determine at what size structure is
|
||||
the transition point between the two possibilities. */
|
||||
|
||||
static void
|
||||
generate_struct_by_value_array ()
|
||||
|
@ -461,7 +460,7 @@ generate_struct_by_value_array ()
|
|||
int aggregate_in_mem[32];
|
||||
int found = 0;
|
||||
|
||||
/* Presumably no platform passes 32 byte structures in a register. */
|
||||
/* Presumably no platform passes 32 byte structures in a register. */
|
||||
for (i = 1; i < 32; i++)
|
||||
{
|
||||
char buffer[5];
|
||||
|
@ -491,7 +490,7 @@ generate_struct_by_value_array ()
|
|||
}
|
||||
|
||||
/* We found some structures that are returned in registers instead of memory
|
||||
so output the necessary data. */
|
||||
so output the necessary data. */
|
||||
if (found)
|
||||
{
|
||||
for (i = 31; i >= 0; i--)
|
||||
|
@ -684,38 +683,38 @@ lookup_method_in_protocol_list (rproto_list, sel_name, class_meth)
|
|||
|
||||
static tree
|
||||
lookup_protocol_in_reflist (rproto_list, lproto)
|
||||
tree rproto_list;
|
||||
tree lproto;
|
||||
tree rproto_list;
|
||||
tree lproto;
|
||||
{
|
||||
tree rproto, p;
|
||||
tree rproto, p;
|
||||
|
||||
/* Make sure the protocol is supported by the object on the rhs. */
|
||||
if (TREE_CODE (lproto) == PROTOCOL_INTERFACE_TYPE)
|
||||
{
|
||||
tree fnd = 0;
|
||||
for (rproto = rproto_list; rproto; rproto = TREE_CHAIN (rproto))
|
||||
{
|
||||
p = TREE_VALUE (rproto);
|
||||
/* Make sure the protocol is supported by the object on the rhs. */
|
||||
if (TREE_CODE (lproto) == PROTOCOL_INTERFACE_TYPE)
|
||||
{
|
||||
tree fnd = 0;
|
||||
for (rproto = rproto_list; rproto; rproto = TREE_CHAIN (rproto))
|
||||
{
|
||||
p = TREE_VALUE (rproto);
|
||||
|
||||
if (TREE_CODE (p) == PROTOCOL_INTERFACE_TYPE)
|
||||
{
|
||||
if (lproto == p)
|
||||
fnd = lproto;
|
||||
if (TREE_CODE (p) == PROTOCOL_INTERFACE_TYPE)
|
||||
{
|
||||
if (lproto == p)
|
||||
fnd = lproto;
|
||||
|
||||
else if (PROTOCOL_LIST (p))
|
||||
fnd = lookup_protocol_in_reflist (PROTOCOL_LIST (p), lproto);
|
||||
}
|
||||
else if (PROTOCOL_LIST (p))
|
||||
fnd = lookup_protocol_in_reflist (PROTOCOL_LIST (p), lproto);
|
||||
}
|
||||
|
||||
if (fnd)
|
||||
return fnd;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
; /* An identifier...if we could not find a protocol. */
|
||||
}
|
||||
if (fnd)
|
||||
return fnd;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
; /* An identifier...if we could not find a protocol. */
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return 1 if LHS and RHS are compatible types for assignment
|
||||
|
@ -1563,8 +1562,8 @@ init_objc_symtab (type)
|
|||
return build_constructor (type, nreverse (initlist));
|
||||
}
|
||||
|
||||
/* Push forward-declarations of all the categories
|
||||
so that init_def_list can use them in a CONSTRUCTOR. */
|
||||
/* Push forward-declarations of all the categories so that
|
||||
init_def_list can use them in a CONSTRUCTOR. */
|
||||
|
||||
static void
|
||||
forward_declare_categories ()
|
||||
|
@ -2204,7 +2203,7 @@ add_class_reference (ident)
|
|||
|
||||
tree
|
||||
get_class_reference (ident)
|
||||
tree ident;
|
||||
tree ident;
|
||||
{
|
||||
if (flag_next_runtime)
|
||||
{
|
||||
|
@ -2829,17 +2828,15 @@ generate_descriptor_table (type, name, size, list, proto)
|
|||
}
|
||||
|
||||
static void
|
||||
generate_method_descriptors (protocol) /* generate_dispatch_tables */
|
||||
tree protocol;
|
||||
generate_method_descriptors (protocol)
|
||||
tree protocol;
|
||||
{
|
||||
tree initlist, chain, method_list_template;
|
||||
tree cast, variable_length_type;
|
||||
int size;
|
||||
|
||||
if (!objc_method_prototype_template)
|
||||
{
|
||||
objc_method_prototype_template = build_method_prototype_template ();
|
||||
}
|
||||
objc_method_prototype_template = build_method_prototype_template ();
|
||||
|
||||
cast = build_tree_list (build_tree_list (NULL_TREE, xref_tag (RECORD_TYPE,
|
||||
get_identifier (UTAG_METHOD_PROTOTYPE_LIST))),
|
||||
|
@ -3750,7 +3747,7 @@ build_ivar_list_initializer (type, field_decl)
|
|||
ivar);
|
||||
obstack_free (&util_obstack, util_firstobj);
|
||||
|
||||
/* Set offset. */
|
||||
/* Set offset. */
|
||||
ivar = tree_cons (NULL_TREE, byte_position (field_decl), ivar);
|
||||
initlist = tree_cons (NULL_TREE,
|
||||
build_constructor (type, nreverse (ivar)),
|
||||
|
@ -4855,7 +4852,7 @@ finish_message_expr (receiver, sel_name, method_params)
|
|||
tree selector, self_object, retval;
|
||||
int statically_typed = 0, statically_allocated = 0;
|
||||
|
||||
/* Determine receiver type. */
|
||||
/* Determine receiver type. */
|
||||
tree rtype = TREE_TYPE (receiver);
|
||||
int super = IS_SUPER (rtype);
|
||||
|
||||
|
@ -4880,7 +4877,7 @@ finish_message_expr (receiver, sel_name, method_params)
|
|||
if (statically_allocated)
|
||||
receiver = build_unary_op (ADDR_EXPR, receiver, 0);
|
||||
|
||||
/* Don't evaluate the receiver twice. */
|
||||
/* Don't evaluate the receiver twice. */
|
||||
receiver = save_expr (receiver);
|
||||
self_object = receiver;
|
||||
}
|
||||
|
@ -5923,7 +5920,7 @@ check_methods_accessible (chain, context, mtype)
|
|||
|
||||
chain = TREE_CHAIN (chain); /* next method... */
|
||||
}
|
||||
return first;
|
||||
return first;
|
||||
}
|
||||
|
||||
/* Check whether the current interface (accessible via
|
||||
|
@ -5971,6 +5968,7 @@ check_protocol (p, type, name)
|
|||
tree subs = PROTOCOL_LIST (p);
|
||||
tree super_class =
|
||||
lookup_interface (CLASS_SUPER_NAME (implementation_template));
|
||||
|
||||
while (subs)
|
||||
{
|
||||
tree sub = TREE_VALUE (subs);
|
||||
|
@ -6315,10 +6313,8 @@ lookup_protocol (ident)
|
|||
tree chain;
|
||||
|
||||
for (chain = protocol_chain; chain; chain = TREE_CHAIN (chain))
|
||||
{
|
||||
if (ident == PROTOCOL_NAME (chain))
|
||||
return chain;
|
||||
}
|
||||
if (ident == PROTOCOL_NAME (chain))
|
||||
return chain;
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -6395,7 +6391,7 @@ start_protocol (code, name, list)
|
|||
|
||||
void
|
||||
finish_protocol (protocol)
|
||||
tree protocol ATTRIBUTE_UNUSED;
|
||||
tree protocol ATTRIBUTE_UNUSED;
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -6537,12 +6533,12 @@ encode_aggregate_within (type, curtype, format, left, right)
|
|||
{
|
||||
tree name = TYPE_NAME (type);
|
||||
|
||||
/* we have a reference; this is a NeXT extension. */
|
||||
/* we have a reference; this is a NeXT extension. */
|
||||
|
||||
if (obstack_object_size (&util_obstack) - curtype == 1
|
||||
&& format == OBJC_ENCODE_INLINE_DEFS)
|
||||
{
|
||||
/* Output format of struct for first level only. */
|
||||
/* Output format of struct for first level only. */
|
||||
tree fields = TYPE_FIELDS (type);
|
||||
|
||||
if (name && TREE_CODE (name) == IDENTIFIER_NODE)
|
||||
|
@ -6576,7 +6572,7 @@ encode_aggregate_within (type, curtype, format, left, right)
|
|||
|
||||
else
|
||||
{
|
||||
/* We have an untagged structure or a typedef. */
|
||||
/* We have an untagged structure or a typedef. */
|
||||
obstack_1grow (&util_obstack, left);
|
||||
obstack_1grow (&util_obstack, '?');
|
||||
obstack_1grow (&util_obstack, right);
|
||||
|
@ -6632,7 +6628,7 @@ encode_aggregate_within (type, curtype, format, left, right)
|
|||
IDENTIFIER_POINTER (name),
|
||||
strlen (IDENTIFIER_POINTER (name)));
|
||||
else
|
||||
/* We have an untagged structure or a typedef. */
|
||||
/* We have an untagged structure or a typedef. */
|
||||
obstack_1grow (&util_obstack, '?');
|
||||
|
||||
obstack_1grow (&util_obstack, right);
|
||||
|
@ -7193,7 +7189,7 @@ get_super_receiver ()
|
|||
tree super_name = CLASS_SUPER_NAME (implementation_template);
|
||||
tree super_class;
|
||||
|
||||
/* Barf if super used in a category of Object. */
|
||||
/* Barf if super used in a category of Object. */
|
||||
if (!super_name)
|
||||
{
|
||||
error ("no super class declared in interface for `%s'",
|
||||
|
@ -7970,7 +7966,7 @@ dump_interface (fp, chain)
|
|||
FILE *fp;
|
||||
tree chain;
|
||||
{
|
||||
char *buf = (char *)xmalloc (256);
|
||||
char *buf = (char *) xmalloc (256);
|
||||
const char *my_name = IDENTIFIER_POINTER (CLASS_NAME (chain));
|
||||
tree ivar_decls = CLASS_RAW_IVARS (chain);
|
||||
tree nst_methods = CLASS_NST_METHODS (chain);
|
||||
|
@ -8099,7 +8095,7 @@ init_objc ()
|
|||
gcc_obstack_init (&util_obstack);
|
||||
util_firstobj = (char *) obstack_finish (&util_obstack);
|
||||
|
||||
errbuf = (char *)xmalloc (BUFSIZE);
|
||||
errbuf = (char *) xmalloc (BUFSIZE);
|
||||
hash_init ();
|
||||
synth_module_prologue ();
|
||||
}
|
||||
|
@ -8130,7 +8126,7 @@ finish_objc ()
|
|||
#endif
|
||||
|
||||
/* Process the static instances here because initialization of objc_symtab
|
||||
depends on them. */
|
||||
depends on them. */
|
||||
if (objc_static_instances)
|
||||
generate_static_references ();
|
||||
|
||||
|
@ -8171,7 +8167,7 @@ finish_objc ()
|
|||
if (objc_implementation_context || class_names_chain || objc_static_instances
|
||||
|| meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
|
||||
{
|
||||
/* Arrange for Objc data structures to be initialized at run time. */
|
||||
/* Arrange for ObjC data structures to be initialized at run time. */
|
||||
rtx init_sym = build_module_descriptor ();
|
||||
if (init_sym && targetm.have_ctors_dtors)
|
||||
(* targetm.asm_out.constructor) (init_sym, DEFAULT_INIT_PRIORITY);
|
||||
|
@ -8250,7 +8246,7 @@ finish_objc ()
|
|||
|
||||
static void
|
||||
generate_classref_translation_entry (chain)
|
||||
tree chain;
|
||||
tree chain;
|
||||
{
|
||||
tree expr, name, decl_specs, decl, sc_spec;
|
||||
tree type;
|
||||
|
@ -8346,7 +8342,7 @@ handle_impent (impent)
|
|||
|
||||
/* Do the same for categories. Even though no references to
|
||||
these symbols are generated automatically by the compiler, it
|
||||
gives you a handle to pull them into an archive by hand. */
|
||||
gives you a handle to pull them into an archive by hand. */
|
||||
sprintf (string, "*%sobjc_category_name_%s_%s",
|
||||
(flag_next_runtime ? "." : "__"), class_name, class_super_name);
|
||||
}
|
||||
|
@ -8371,7 +8367,7 @@ handle_impent (impent)
|
|||
|
||||
static void
|
||||
ggc_mark_imp_list (arg)
|
||||
void *arg;
|
||||
void *arg;
|
||||
{
|
||||
struct imp_entry *impent;
|
||||
|
||||
|
@ -8386,7 +8382,7 @@ ggc_mark_imp_list (arg)
|
|||
|
||||
static void
|
||||
ggc_mark_hash_table (arg)
|
||||
void *arg;
|
||||
void *arg;
|
||||
{
|
||||
hash *hash_table = *(hash **)arg;
|
||||
hash hst;
|
||||
|
|
Loading…
Reference in New Issue