mirror of git://gcc.gnu.org/git/gcc.git
In libobjc/: 2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/: 2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com> * objc-private/module-abi-8.h (class_get_instance_size): Removed. * objects.c (class_create_instance): Removed. * error.c (__USE_FIXED_PROTOTYPES__): Removed. * gc.c (__objc_generate_gc_type_description): Use class_getInstanceSize() instead of class_get_instance_size(). * selector.c (sel_types_match): Made static. (sel_get_typed_uid): Removed. (sel_get_any_typed_uid): Removed. (sel_get_name): Removed. (sel_get_type): Removed. (sel_register_name): Removed. (sel_register_typed_name): Removed. (sel_get_uid): Removed. From-SVN: r174773
This commit is contained in:
parent
3ff6097510
commit
0b0b41a89e
|
|
@ -1,3 +1,19 @@
|
||||||
|
2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
|
* objc-private/module-abi-8.h (class_get_instance_size): Removed.
|
||||||
|
* objects.c (class_create_instance): Removed.
|
||||||
|
* error.c (__USE_FIXED_PROTOTYPES__): Removed.
|
||||||
|
* gc.c (__objc_generate_gc_type_description): Use
|
||||||
|
class_getInstanceSize() instead of class_get_instance_size().
|
||||||
|
* selector.c (sel_types_match): Made static.
|
||||||
|
(sel_get_typed_uid): Removed.
|
||||||
|
(sel_get_any_typed_uid): Removed.
|
||||||
|
(sel_get_name): Removed.
|
||||||
|
(sel_get_type): Removed.
|
||||||
|
(sel_register_name): Removed.
|
||||||
|
(sel_register_typed_name): Removed.
|
||||||
|
(sel_get_uid): Removed.
|
||||||
|
|
||||||
2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com>
|
2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
* encoding.c (method_get_number_of_arguments): Removed.
|
* encoding.c (method_get_number_of_arguments): Removed.
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
#include "objc-private/common.h"
|
#include "objc-private/common.h"
|
||||||
#include "objc-private/error.h"
|
#include "objc-private/error.h"
|
||||||
|
|
||||||
/* __USE_FIXED_PROTOTYPES__ used to be required to get prototypes for
|
|
||||||
malloc, free, etc. on some platforms. It is unclear if we still
|
|
||||||
need it, but it can't hurt. */
|
|
||||||
#define __USE_FIXED_PROTOTYPES__
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ __objc_generate_gc_type_description (Class class)
|
||||||
|
|
||||||
/* The number of bits in the mask is the size of an instance in bytes divided
|
/* The number of bits in the mask is the size of an instance in bytes divided
|
||||||
by the size of a pointer. */
|
by the size of a pointer. */
|
||||||
bits_no = (ROUND (class_get_instance_size (class), sizeof (void *))
|
bits_no = (ROUND (class_getInstanceSize (class), sizeof (void *))
|
||||||
/ sizeof (void *));
|
/ sizeof (void *));
|
||||||
size = ROUND (bits_no, BITS_PER_WORD) / BITS_PER_WORD;
|
size = ROUND (bits_no, BITS_PER_WORD) / BITS_PER_WORD;
|
||||||
mask = objc_atomic_malloc (size * sizeof (int));
|
mask = objc_atomic_malloc (size * sizeof (int));
|
||||||
|
|
|
||||||
|
|
@ -277,12 +277,6 @@ struct objc_class {
|
||||||
(cls)->info >>= (HOST_BITS_PER_LONG/2); \
|
(cls)->info >>= (HOST_BITS_PER_LONG/2); \
|
||||||
__CLS_SETINFO(cls, (((unsigned long)num) << (HOST_BITS_PER_LONG/2))); })
|
__CLS_SETINFO(cls, (((unsigned long)num) << (HOST_BITS_PER_LONG/2))); })
|
||||||
|
|
||||||
static inline long
|
|
||||||
class_get_instance_size(Class _class)
|
|
||||||
{
|
|
||||||
return CLS_ISCLASS(_class)?_class->instance_size:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The compiler generates one of these structures for each category.
|
/* The compiler generates one of these structures for each category.
|
||||||
A class may have many categories and contain both instance and
|
A class may have many categories and contain both instance and
|
||||||
factory methods. */
|
factory methods. */
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,6 @@ class_createInstance (Class class, size_t extraBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Traditional GNU Objective-C Runtime API. */
|
/* Traditional GNU Objective-C Runtime API. */
|
||||||
id
|
|
||||||
class_create_instance (Class class)
|
|
||||||
{
|
|
||||||
return class_createInstance (class, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
id
|
id
|
||||||
object_copy (id object, size_t extraBytes)
|
object_copy (id object, size_t extraBytes)
|
||||||
{
|
{
|
||||||
|
|
@ -122,4 +116,3 @@ object_setClass (id object, Class class_)
|
||||||
return old_class;
|
return old_class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ sel_isEqual (SEL s1, SEL s2)
|
||||||
|
|
||||||
/* Return YES iff t1 and t2 have same method types. Ignore the
|
/* Return YES iff t1 and t2 have same method types. Ignore the
|
||||||
argframe layout. */
|
argframe layout. */
|
||||||
BOOL
|
static BOOL
|
||||||
sel_types_match (const char *t1, const char *t2)
|
sel_types_match (const char *t1, const char *t2)
|
||||||
{
|
{
|
||||||
if (! t1 || ! t2)
|
if (! t1 || ! t2)
|
||||||
|
|
@ -252,83 +252,6 @@ sel_types_match (const char *t1, const char *t2)
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return selector representing name. In the Modern API, you'd
|
|
||||||
normally use sel_registerTypedName() for this, which does the same
|
|
||||||
but would register the selector with the runtime if not registered
|
|
||||||
yet (if you only want to check for selectors without registering,
|
|
||||||
use sel_copyTypedSelectorList()). */
|
|
||||||
SEL
|
|
||||||
sel_get_typed_uid (const char *name, const char *types)
|
|
||||||
{
|
|
||||||
struct objc_list *l;
|
|
||||||
sidx i;
|
|
||||||
|
|
||||||
objc_mutex_lock (__objc_runtime_mutex);
|
|
||||||
|
|
||||||
i = (sidx) objc_hash_value_for_key (__objc_selector_hash, name);
|
|
||||||
if (i == 0)
|
|
||||||
{
|
|
||||||
objc_mutex_unlock (__objc_runtime_mutex);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (l = (struct objc_list *) sarray_get_safe (__objc_selector_array, i);
|
|
||||||
l; l = l->tail)
|
|
||||||
{
|
|
||||||
SEL s = (SEL) l->head;
|
|
||||||
if (types == 0 || s->sel_types == 0)
|
|
||||||
{
|
|
||||||
if (s->sel_types == types)
|
|
||||||
{
|
|
||||||
objc_mutex_unlock (__objc_runtime_mutex);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (sel_types_match (s->sel_types, types))
|
|
||||||
{
|
|
||||||
objc_mutex_unlock (__objc_runtime_mutex);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
objc_mutex_unlock (__objc_runtime_mutex);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return selector representing name; prefer a selector with non-NULL
|
|
||||||
type. In the Modern API, sel_getTypedSelector() is similar but
|
|
||||||
returns NULL if a typed selector couldn't be found. */
|
|
||||||
SEL
|
|
||||||
sel_get_any_typed_uid (const char *name)
|
|
||||||
{
|
|
||||||
struct objc_list *l;
|
|
||||||
sidx i;
|
|
||||||
SEL s = NULL;
|
|
||||||
|
|
||||||
objc_mutex_lock (__objc_runtime_mutex);
|
|
||||||
|
|
||||||
i = (sidx) objc_hash_value_for_key (__objc_selector_hash, name);
|
|
||||||
if (i == 0)
|
|
||||||
{
|
|
||||||
objc_mutex_unlock (__objc_runtime_mutex);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (l = (struct objc_list *) sarray_get_safe (__objc_selector_array, i);
|
|
||||||
l; l = l->tail)
|
|
||||||
{
|
|
||||||
s = (SEL) l->head;
|
|
||||||
if (s->sel_types)
|
|
||||||
{
|
|
||||||
objc_mutex_unlock (__objc_runtime_mutex);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
objc_mutex_unlock (__objc_runtime_mutex);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return selector representing name. */
|
/* Return selector representing name. */
|
||||||
SEL
|
SEL
|
||||||
sel_get_any_uid (const char *name)
|
sel_get_any_uid (const char *name)
|
||||||
|
|
@ -493,15 +416,6 @@ const char *sel_getName (SEL selector)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Traditional GNU Objective-C Runtime API. */
|
|
||||||
const char *sel_get_name (SEL selector)
|
|
||||||
{
|
|
||||||
if (selector == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return sel_getName (selector);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
sel_is_mapped (SEL selector)
|
sel_is_mapped (SEL selector)
|
||||||
{
|
{
|
||||||
|
|
@ -517,12 +431,6 @@ const char *sel_getTypeEncoding (SEL selector)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Traditional GNU Objective-C Runtime API. */
|
|
||||||
const char *sel_get_type (SEL selector)
|
|
||||||
{
|
|
||||||
return sel_getTypeEncoding (selector);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The uninstalled dispatch table. */
|
/* The uninstalled dispatch table. */
|
||||||
extern struct sarray *__objc_uninstalled_dtable;
|
extern struct sarray *__objc_uninstalled_dtable;
|
||||||
|
|
||||||
|
|
@ -707,13 +615,6 @@ sel_registerName (const char *name)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Traditional GNU Objective-C Runtime API. */
|
|
||||||
SEL
|
|
||||||
sel_register_name (const char *name)
|
|
||||||
{
|
|
||||||
return sel_registerName (name);
|
|
||||||
}
|
|
||||||
|
|
||||||
SEL
|
SEL
|
||||||
sel_registerTypedName (const char *name, const char *type)
|
sel_registerTypedName (const char *name, const char *type)
|
||||||
{
|
{
|
||||||
|
|
@ -732,22 +633,9 @@ sel_registerTypedName (const char *name, const char *type)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEL
|
|
||||||
sel_register_typed_name (const char *name, const char *type)
|
|
||||||
{
|
|
||||||
return sel_registerTypedName (name, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the selector representing name. */
|
/* Return the selector representing name. */
|
||||||
SEL
|
SEL
|
||||||
sel_getUid (const char *name)
|
sel_getUid (const char *name)
|
||||||
{
|
{
|
||||||
return sel_registerTypedName (name, 0);
|
return sel_registerTypedName (name, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Traditional GNU Objective-C Runtime API. */
|
|
||||||
SEL
|
|
||||||
sel_get_uid (const char *name)
|
|
||||||
{
|
|
||||||
return sel_getUid (name);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue