mirror of git://gcc.gnu.org/git/gcc.git
In gcc/testsuite/: 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/testsuite/: 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/gnu-api-2-resolve-method.m: Include objc/message.h. * obj-c++.dg/gnu-api-2-resolve-method.m: Include objc/message.h. In libobjc/: 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com> * Makefile.in (OBJC_DEPRECATED_H): Added objc_msg_sendv.h. * objc/deprecated/objc_msg_sendv.h: New. * objc/message.h: Do not define retval_t, apply_t, arglist, arglist_t, objc_msg_sendv, now in objc/deprecated/objc_msg_sendv.h. * objc/objc.h: Do not include message.h; include objc/deprecated/objc_msg_sendv.h instead. Tidied up comments. * sendmsg.c: Include objc/message.h. * thr.c: Include objc/message.h. From-SVN: r168042
This commit is contained in:
parent
805a07f15e
commit
5ec582f938
|
@ -1,3 +1,8 @@
|
||||||
|
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
|
* objc.dg/gnu-api-2-resolve-method.m: Include objc/message.h.
|
||||||
|
* obj-c++.dg/gnu-api-2-resolve-method.m: Include objc/message.h.
|
||||||
|
|
||||||
2010-12-18 Jakub Jelinek <jakub@redhat.com>
|
2010-12-18 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR tree-optimization/46969
|
PR tree-optimization/46969
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
/* To get the modern GNU Objective-C Runtime API, you include
|
/* To get the modern GNU Objective-C Runtime API, you include
|
||||||
objc/runtime.h. */
|
objc/runtime.h. */
|
||||||
#include <objc/runtime.h>
|
#include <objc/runtime.h>
|
||||||
|
|
||||||
|
/* For __objc_msg_forward2. */
|
||||||
|
#include <objc/message.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
/* To get the modern GNU Objective-C Runtime API, you include
|
/* To get the modern GNU Objective-C Runtime API, you include
|
||||||
objc/runtime.h. */
|
objc/runtime.h. */
|
||||||
#include <objc/runtime.h>
|
#include <objc/runtime.h>
|
||||||
|
|
||||||
|
/* For __objc_msg_forward2. */
|
||||||
|
#include <objc/message.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
|
* Makefile.in (OBJC_DEPRECATED_H): Added objc_msg_sendv.h.
|
||||||
|
* objc/deprecated/objc_msg_sendv.h: New.
|
||||||
|
* objc/message.h: Do not define retval_t, apply_t, arglist,
|
||||||
|
arglist_t, objc_msg_sendv, now in
|
||||||
|
objc/deprecated/objc_msg_sendv.h.
|
||||||
|
* objc/objc.h: Do not include message.h; include
|
||||||
|
objc/deprecated/objc_msg_sendv.h instead. Tidied up comments.
|
||||||
|
* sendmsg.c: Include objc/message.h.
|
||||||
|
* thr.c: Include objc/message.h.
|
||||||
|
|
||||||
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
|
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
* objc/objc-exception.h: Include objc-decls.h. Mark all
|
* objc/objc-exception.h: Include objc-decls.h. Mark all
|
||||||
|
|
|
@ -142,6 +142,7 @@ OBJC_DEPRECATED_H = \
|
||||||
objc_error.h \
|
objc_error.h \
|
||||||
objc_get_uninstalled_dtable.h \
|
objc_get_uninstalled_dtable.h \
|
||||||
objc_malloc.h \
|
objc_malloc.h \
|
||||||
|
objc_msg_sendv.h \
|
||||||
objc_object_alloc.h \
|
objc_object_alloc.h \
|
||||||
objc_unexpected_exception.h \
|
objc_unexpected_exception.h \
|
||||||
objc_valloc.h \
|
objc_valloc.h \
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* The following types and functions are provided only for
|
||||||
|
backwards-compatibility and should not be used in new code. They
|
||||||
|
were deprecated in GCC 4.6 and will be removed in the next
|
||||||
|
release. */
|
||||||
|
typedef void* retval_t; /* return value */
|
||||||
|
typedef void(*apply_t)(void); /* function pointer */
|
||||||
|
typedef union arglist {
|
||||||
|
char *arg_ptr;
|
||||||
|
char arg_regs[sizeof (char*)];
|
||||||
|
} *arglist_t; /* argument frame */
|
||||||
|
|
||||||
|
objc_EXPORT retval_t objc_msg_sendv(id, SEL, arglist_t);
|
|
@ -137,20 +137,6 @@ objc_EXPORT IMP objc_msg_lookup_super (struct objc_super *super, SEL sel);
|
||||||
objc_EXPORT IMP (*__objc_msg_forward)(SEL);
|
objc_EXPORT IMP (*__objc_msg_forward)(SEL);
|
||||||
objc_EXPORT IMP (*__objc_msg_forward2)(id, SEL);
|
objc_EXPORT IMP (*__objc_msg_forward2)(id, SEL);
|
||||||
|
|
||||||
|
|
||||||
/* The following types and functions are provided only for
|
|
||||||
backwards-compatibility and should not be used in new code. They
|
|
||||||
were deprecated in GCC 4.6 and will be removed in the next
|
|
||||||
release. */
|
|
||||||
typedef void* retval_t; /* return value */
|
|
||||||
typedef void(*apply_t)(void); /* function pointer */
|
|
||||||
typedef union arglist {
|
|
||||||
char *arg_ptr;
|
|
||||||
char arg_regs[sizeof (char*)];
|
|
||||||
} *arglist_t; /* argument frame */
|
|
||||||
|
|
||||||
objc_EXPORT retval_t objc_msg_sendv(id, SEL, arglist_t);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -28,8 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
|
|
||||||
/* This file contains the definition of the basic types used by the
|
/* This file contains the definition of the basic types used by the
|
||||||
Objective-C language. It needs to be included to do almost
|
Objective-C language. It needs to be included to do almost
|
||||||
anything with Objective-C.
|
anything with Objective-C. */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -37,25 +36,27 @@ extern "C" {
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
/* objc-decls.h is included because deprecated/objc_msg_sendv.h needs
|
||||||
|
it. When that goes away, the include of objc-decls.h should be
|
||||||
|
removed. */
|
||||||
|
#include "objc-decls.h"
|
||||||
|
|
||||||
/* The current version of the GNU Objective-C Runtime library in
|
/* The current version of the GNU Objective-C Runtime library in
|
||||||
compressed ISO date format. This should be updated any time a new
|
compressed ISO date format. This should be updated any time a new
|
||||||
version is released with changes to the public API (there is no
|
version is released with changes to the public API (there is no
|
||||||
need to update it if there were no API changes since the previous
|
need to update it if there were no API changes since the previous
|
||||||
release). This macro is only defined starting with the GNU
|
release). This macro is only defined starting with the GNU
|
||||||
Objective-C Runtime shipped with GCC 4.6.0. If it is not defined,
|
Objective-C Runtime shipped with GCC 4.6.0. If it is not defined,
|
||||||
it is either an older version of the runtime, or another runtime.
|
it is either an older version of the runtime, or another runtime. */
|
||||||
*/
|
|
||||||
#define __GNU_LIBOBJC__ 20100911
|
#define __GNU_LIBOBJC__ 20100911
|
||||||
|
|
||||||
/*
|
/* Definition of the boolean type.
|
||||||
Definition of the boolean type.
|
|
||||||
|
|
||||||
Compatibility note: the Apple/NeXT runtime defines a BOOL as a
|
Compatibility note: the Apple/NeXT runtime defines a BOOL as a
|
||||||
'signed char'. The GNU runtime uses an 'unsigned char'.
|
'signed char'. The GNU runtime uses an 'unsigned char'.
|
||||||
|
|
||||||
Important: this could change and we could switch to 'typedef bool
|
Important: this could change and we could switch to 'typedef bool
|
||||||
BOOL' in the future. Do not depend on the type of BOOL.
|
BOOL' in the future. Do not depend on the type of BOOL. */
|
||||||
*/
|
|
||||||
#undef BOOL
|
#undef BOOL
|
||||||
typedef unsigned char BOOL;
|
typedef unsigned char BOOL;
|
||||||
|
|
||||||
|
@ -65,8 +66,7 @@ typedef unsigned char BOOL;
|
||||||
/* The basic Objective-C types (SEL, Class, id) are defined as pointer
|
/* The basic Objective-C types (SEL, Class, id) are defined as pointer
|
||||||
to opaque structures. The details of the structures are private to
|
to opaque structures. The details of the structures are private to
|
||||||
the runtime and may potentially change from one version to the
|
the runtime and may potentially change from one version to the
|
||||||
other.
|
other. */
|
||||||
*/
|
|
||||||
|
|
||||||
/* A SEL (selector) represents an abstract method (in the
|
/* A SEL (selector) represents an abstract method (in the
|
||||||
object-oriented sense) and includes all the details of how to
|
object-oriented sense) and includes all the details of how to
|
||||||
|
@ -74,16 +74,14 @@ typedef unsigned char BOOL;
|
||||||
types) but provides no implementation of its own. You can check
|
types) but provides no implementation of its own. You can check
|
||||||
whether a class implements a selector or not, and if you have a
|
whether a class implements a selector or not, and if you have a
|
||||||
selector and know that the class implements it, you can use it to
|
selector and know that the class implements it, you can use it to
|
||||||
call the method for an object in the class.
|
call the method for an object in the class. */
|
||||||
*/
|
|
||||||
typedef const struct objc_selector *SEL;
|
typedef const struct objc_selector *SEL;
|
||||||
#include "deprecated/struct_objc_selector.h"
|
#include "deprecated/struct_objc_selector.h"
|
||||||
|
|
||||||
/* A Class is a class (in the object-oriented sense). In Objective-C
|
/* A Class is a class (in the object-oriented sense). In Objective-C
|
||||||
there is the complication that each Class is an object itself, and
|
there is the complication that each Class is an object itself, and
|
||||||
so belongs to a class too. This class that a class belongs to is
|
so belongs to a class too. This class that a class belongs to is
|
||||||
called its 'meta class'.
|
called its 'meta class'. */
|
||||||
*/
|
|
||||||
typedef struct objc_class *Class;
|
typedef struct objc_class *Class;
|
||||||
#include "deprecated/MetaClass.h"
|
#include "deprecated/MetaClass.h"
|
||||||
#include "deprecated/struct_objc_class.h"
|
#include "deprecated/struct_objc_class.h"
|
||||||
|
@ -91,32 +89,29 @@ typedef struct objc_class *Class;
|
||||||
/* An 'id' is an object of an unknown class. The way the object data
|
/* An 'id' is an object of an unknown class. The way the object data
|
||||||
is stored inside the object is private and what you see here is
|
is stored inside the object is private and what you see here is
|
||||||
only the beginning of the actual struct. The first field is always
|
only the beginning of the actual struct. The first field is always
|
||||||
a pointer to the Class that the object belongs to.
|
a pointer to the Class that the object belongs to. */
|
||||||
*/
|
|
||||||
typedef struct objc_object
|
typedef struct objc_object
|
||||||
{
|
{
|
||||||
/* 'class_pointer' is the Class that the object belongs to. In case
|
/* 'class_pointer' is the Class that the object belongs to. In case
|
||||||
of a Class object, this pointer points to the meta class.
|
of a Class object, this pointer points to the meta class.
|
||||||
|
|
||||||
Compatibility Note: The Apple/NeXT runtime calls this field
|
Compatibility Note: The Apple/NeXT runtime calls this field
|
||||||
'isa'. To access this field in a portable way, use
|
'isa'. To access this field, use object_getClass() from
|
||||||
object_getClass() from runtime.h, which is an inline function so
|
runtime.h, which is an inline function so does not add any
|
||||||
does not add any overhead. */
|
overhead and is also portable to other runtimes. */
|
||||||
Class class_pointer;
|
Class class_pointer;
|
||||||
} *id;
|
} *id;
|
||||||
|
|
||||||
/*
|
/* 'IMP' is a C function that implements a method. When retrieving
|
||||||
'IMP' is a C function that implements a method. When retrieving the
|
the implementation of a method from the runtime, this is the type
|
||||||
implementation of a method from the runtime, this is the type of the
|
of the pointer returned. The idea of the definition of IMP is to
|
||||||
pointer returned. The idea of the definition of IMP is to represent
|
represent a 'pointer to a general function taking an id, a SEL,
|
||||||
a 'pointer to a general function taking an id, a SEL, followed by
|
followed by other unspecified arguments'. You must always cast an
|
||||||
other unspecified arguments'. You must always cast an IMP to a
|
IMP to a pointer to a function taking the appropriate, specific
|
||||||
pointer to a function taking the appropriate, specific types for
|
types for that function, before calling it - to make sure the
|
||||||
that function, before calling it - to make sure the appropriate
|
appropriate arguments are passed to it. The code generated by the
|
||||||
arguments are passed to it. The code generated by the compiler to
|
compiler to perform method calls automatically does this cast
|
||||||
perform method calls automatically does this cast inside method
|
inside method calls. */
|
||||||
calls.
|
|
||||||
*/
|
|
||||||
typedef id (*IMP)(id, SEL, ...);
|
typedef id (*IMP)(id, SEL, ...);
|
||||||
|
|
||||||
/* 'nil' is the null object. Messages to nil do nothing and always
|
/* 'nil' is the null object. Messages to nil do nothing and always
|
||||||
|
@ -135,21 +130,18 @@ typedef id (*IMP)(id, SEL, ...);
|
||||||
/* TODO: Move the 'Protocol' declaration into objc/runtime.h. A
|
/* TODO: Move the 'Protocol' declaration into objc/runtime.h. A
|
||||||
Protocol is simply an object, not a basic Objective-C type. The
|
Protocol is simply an object, not a basic Objective-C type. The
|
||||||
Apple runtime defines Protocol in objc/runtime.h too, so it's good
|
Apple runtime defines Protocol in objc/runtime.h too, so it's good
|
||||||
to move it there for API compatibility.
|
to move it there for API compatibility. */
|
||||||
*/
|
|
||||||
|
|
||||||
/* A 'Protocol' is a formally defined list of selectors (normally
|
/* A 'Protocol' is a formally defined list of selectors (normally
|
||||||
created using the @protocol Objective-C syntax). It is mostly used
|
created using the @protocol Objective-C syntax). It is mostly used
|
||||||
at compile-time to check that classes implement all the methods
|
at compile-time to check that classes implement all the methods
|
||||||
that they are supposed to. Protocols are also available in the
|
that they are supposed to. Protocols are also available in the
|
||||||
runtime system as Protocol objects.
|
runtime system as Protocol objects. */
|
||||||
*/
|
|
||||||
#ifndef __OBJC__
|
#ifndef __OBJC__
|
||||||
/* Once we stop including the deprecated struct_objc_protocol.h
|
/* Once we stop including the deprecated struct_objc_protocol.h
|
||||||
there is no reason to even define a 'struct objc_protocol'. As
|
there is no reason to even define a 'struct objc_protocol'. As
|
||||||
all the structure details will be hidden, a Protocol basically is
|
all the structure details will be hidden, a Protocol basically is
|
||||||
simply an object (as it should be).
|
simply an object (as it should be). */
|
||||||
*/
|
|
||||||
/* typedef struct objc_object Protocol; */
|
/* typedef struct objc_object Protocol; */
|
||||||
#include "deprecated/struct_objc_protocol.h"
|
#include "deprecated/struct_objc_protocol.h"
|
||||||
#else /* __OBJC__ */
|
#else /* __OBJC__ */
|
||||||
|
@ -158,8 +150,9 @@ typedef id (*IMP)(id, SEL, ...);
|
||||||
|
|
||||||
/* Deprecated include - here temporarily, for backwards-compatibility
|
/* Deprecated include - here temporarily, for backwards-compatibility
|
||||||
as reval_t, apply_t, arglist_t and objc_msg_lookup() used to be
|
as reval_t, apply_t, arglist_t and objc_msg_lookup() used to be
|
||||||
defined here. */
|
defined here. objc_msg_lookup() is now defined in message.h,
|
||||||
#include "message.h"
|
included by objc-api.h or runtime.h. */
|
||||||
|
#include "deprecated/objc_msg_sendv.h"
|
||||||
|
|
||||||
/* Compatibility note: the Apple/NeXT runtime defines sel_getName(),
|
/* Compatibility note: the Apple/NeXT runtime defines sel_getName(),
|
||||||
sel_registerName(), object_getClassName(), object_getIndexedIvars()
|
sel_registerName(), object_getClassName(), object_getIndexedIvars()
|
||||||
|
@ -167,8 +160,7 @@ typedef id (*IMP)(id, SEL, ...);
|
||||||
|
|
||||||
The reason the GNU runtime does not define them here is that they
|
The reason the GNU runtime does not define them here is that they
|
||||||
are not basic Objective-C types (defined in this file), but are
|
are not basic Objective-C types (defined in this file), but are
|
||||||
part of the runtime API (defined in runtime.h).
|
part of the runtime API (defined in runtime.h). */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
#include "coretypes.h"
|
#include "coretypes.h"
|
||||||
#include "tm.h"
|
#include "tm.h"
|
||||||
#include "objc/runtime.h"
|
#include "objc/runtime.h"
|
||||||
|
#include "objc/message.h" /* For objc_msg_lookup(), objc_msg_lookup_super(). */
|
||||||
#include "objc/thr.h"
|
#include "objc/thr.h"
|
||||||
#include "objc-private/module-abi-8.h"
|
#include "objc-private/module-abi-8.h"
|
||||||
#include "objc-private/runtime.h"
|
#include "objc-private/runtime.h"
|
||||||
|
|
|
@ -38,6 +38,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
#include "tm.h"
|
#include "tm.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include "objc/thr.h"
|
#include "objc/thr.h"
|
||||||
|
#include "objc/message.h" /* For objc_msg_lookup(). */
|
||||||
#include "objc/runtime.h"
|
#include "objc/runtime.h"
|
||||||
#include "objc-private/runtime.h"
|
#include "objc-private/runtime.h"
|
||||||
#include <gthr.h>
|
#include <gthr.h>
|
||||||
|
|
Loading…
Reference in New Issue