Commit c2beaa02 by Nicola Pero Committed by Nicola Pero

Updated comments

From-SVN: r170308
parent 54ba9323
2011-01-19 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-next-runtime-abi-01.c: Updated comments.
* objc-next-runtime-abi-02.c: Same.
2011-01-19 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_init, generate_struct_by_value_array): Updated
comments.
......
......@@ -18,10 +18,10 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* This implements the original NeXT ABI (0) used for m32 code and indicated
by module version 6. It also implements the small number of additions made
for properties and optional protocol methods as ABI=1
(module version 7). */
/* This implements the original NeXT ABI (0) used for m32 code and
indicated by module version 6. It also implements the small number
of additions made for properties and optional protocol methods as
ABI=1 (module version 7). */
#include "config.h"
#include "system.h"
......@@ -39,8 +39,9 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-objc.h"
#include "objc-act.h"
/* When building Objective-C++, we are not linking against the C front-end
and so need to replicate the C tree-construction functions in some way. */
/* When building Objective-C++, we are not linking against the C
front-end and so need to replicate the C tree-construction
functions in some way. */
#ifdef OBJCPLUS
#define OBJCP_REMAP_FUNCTIONS
#include "objcp-decl.h"
......@@ -85,9 +86,9 @@ along with GCC; see the file COPYING3. If not see
#define TAG_MSGSEND_FAST "objc_msgSend_Fast"
#define TAG_ASSIGNIVAR_FAST "objc_assign_ivar_Fast"
/* The version identifies which language generation and runtime
the module (file) was compiled for, and is recorded in the
module descriptor. */
/* The version identifies which language generation and runtime the
module (file) was compiled for, and is recorded in the module
descriptor. */
#define OBJC_VERSION (flag_objc_abi >= 1 ? 7 : 6)
#define UTAG_CLASS_EXT "_objc_class_ext"
......@@ -96,10 +97,10 @@ along with GCC; see the file COPYING3. If not see
#define CLS_HAS_CXX_STRUCTORS 0x2000L
/* rt_trees identifiers - shared between NeXT implementations. These allow
the FE to tag meta-data in a manner that survives LTO and can be used when
the runtime requires that certain meta-data items appear in particular
named sections. */
/* rt_trees identifiers - shared between NeXT implementations. These
allow the FE to tag meta-data in a manner that survives LTO and can
be used when the runtime requires that certain meta-data items
appear in particular named sections. */
#include "objc-next-metadata-tags.h"
extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
......@@ -187,14 +188,15 @@ objc_next_runtime_abi_01_init (objc_runtime_hooks *rthooks)
return true;
}
/* We need a way to convey what kind of meta-data are represented by a given
variable, since each type is expected (by the runtime) to be found in a
specific named section. The solution must be usable with LTO.
/* We need a way to convey what kind of meta-data are represented by a
given variable, since each type is expected (by the runtime) to be
found in a specific named section. The solution must be usable
with LTO.
The scheme used for NeXT ABI 0/1 (partial matching of variable names) is not
satisfactory for LTO & ABI-2. We now tag ObjC meta-data with identification
attributes in the front end. The back-end may choose to act on these as it
requires. */
The scheme used for NeXT ABI 0/1 (partial matching of variable
names) is not satisfactory for LTO & ABI-2. We now tag ObjC
meta-data with identification attributes in the front end. The
back-end may choose to act on these as it requires. */
static void
next_runtime_abi_01_init_metadata_attributes (void)
......@@ -252,7 +254,8 @@ static void next_runtime_01_initialize (void)
tree type;
#ifdef OBJCPLUS
/* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by default. */
/* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by
default. */
if (!global_options_set.x_flag_objc_call_cxx_cdtors)
global_options.x_flag_objc_call_cxx_cdtors = 1;
#endif
......@@ -265,7 +268,8 @@ static void next_runtime_01_initialize (void)
objc_prop_list_ptr = build_pointer_type (xref_tag (RECORD_TYPE,
get_identifier ("_prop_list_t")));
/* Declare type of selector-objects that represent an operation name. */
/* Declare type of selector-objects that represent an operation
name. */
/* `struct objc_selector *' */
objc_selector_type = build_pointer_type (xref_tag (RECORD_TYPE,
get_identifier (TAG_SELECTOR)));
......@@ -306,8 +310,8 @@ static void next_runtime_01_initialize (void)
NULL, NULL_TREE);
/* These can throw, because the function that gets called can throw
in Obj-C++, or could itself call something that can throw even
in Obj-C. */
in Obj-C++, or could itself call something that can throw even in
Obj-C. */
TREE_NOTHROW (umsg_decl) = 0;
TREE_NOTHROW (umsg_nonnil_decl) = 0;
TREE_NOTHROW (umsg_stret_decl) = 0;
......@@ -357,7 +361,8 @@ static void next_runtime_01_initialize (void)
objc_get_meta_class_decl
= add_builtin_function (TAG_GETMETACLASS, type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* This is the type of all of the following functions objc_copyStruct(). */
/* This is the type of all of the following functions
objc_copyStruct(). */
type = build_function_type_list (void_type_node,
ptr_type_node,
const_ptr_type_node,
......@@ -385,7 +390,8 @@ static void next_runtime_01_initialize (void)
/* --- templates --- */
/* struct _objc_class {
/* struct _objc_class
{
struct _objc_class *isa;
struct _objc_class *super_class;
char *name;
......@@ -405,8 +411,9 @@ static void next_runtime_01_initialize (void)
#endif
}; */
/* The 'sel_id' & 'gc_object_type' fields are not used by the NeXT runtime.
We generate them for ABI==0 to maintain backward binary compatibility. */
/* The 'sel_id' & 'gc_object_type' fields are not used by the NeXT
runtime. We generate them for ABI==0 to maintain backward binary
compatibility. */
static void
build_v1_class_template (void)
......@@ -474,16 +481,17 @@ build_v1_class_template (void)
objc_finish_struct (objc_class_template, decls);
}
/* struct _objc_category {
/* struct _objc_category
{
char *category_name;
char *class_name;
struct _objc_method_list *instance_methods;
struct _objc_method_list *class_methods;
struct _objc_protocol_list *protocols;
if ABI=1
#if ABI=1
uint32_t size; // sizeof (struct _objc_category)
struct _objc_property_list *instance_properties; // category's own @property decl.
END
#endif
}; */
static void
......@@ -526,11 +534,13 @@ build_v1_category_template (void)
/* Begin code generation for protocols...
Modified for ObjC #1 extensions. */
/* struct _objc_protocol {
IF ABI=1
/* struct _objc_protocol
{
#if ABI=1
struct _objc_protocol_extension *isa;
ElSE
#else
struct _objc_class *isa;
#endif
char *protocol_name;
struct _objc_protocol **protocol_list;
......@@ -1789,8 +1799,7 @@ generate_v1_category (struct imp_entry *impent)
impent->class_decl = cat_decl;
}
/* This routine builds the class extension used by v1 NeXT.
*/
/* This routine builds the class extension used by v1 NeXT. */
static tree
generate_objc_class_ext (tree property_list, tree context)
......@@ -2357,6 +2366,9 @@ objc_generate_v1_next_metadata (void)
tree chain, attr;
long vers;
/* FIXME: Make sure that we generate no metadata if there is nothing
to put into it. */
if (objc_static_instances)
gcc_unreachable (); /* Not for NeXT */
......
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