summaryrefslogtreecommitdiff
path: root/libobjc/sendmsg.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2004-05-25 19:10:54 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-05-25 12:10:54 -0700
commit435317e25c1f3571a72d97d089ca085ffd0bf20b (patch)
tree4b71d618aec8fb5c67898b26b6eaab9161fdcf1f /libobjc/sendmsg.c
parentf411a73a8caf915d2685c5065de6c918de76daad (diff)
downloadgcc-435317e25c1f3571a72d97d089ca085ffd0bf20b.tar.gz
[multiple changes]
2004-05-25 Andrew Pinski <pinskia@physics.uc.edu> Merge from the libobjc-branch 2004-02-09 Andrew Pinski <pinskia@physics.uc.edu> * Makefile.in (OBJC_H): Change objc-deps.h to objc-decls.h. 2004-02-03 Andrew Pinski <pinskia@physics.uc.edu> * Makefile.in (OBJC_H): Add objc-deps.h. 2004-01-27 Nicola Pero <n.pero@mi.flashnet.it> * Protocol.m ([-conformsTo:]): If the argument is nil, return NO. ([-hash], [-isEqual:]): New methods. 2004-01-27 Richard Frith-Macdonald <rfm@gnu.org> * sarray.c (sarray_free): Add a better comment. 2004-01-27 Adam Fedor <fedor@gnu.org> * hash.c (hash_add): Cast cachep to int. * selector.c (__sel_register_typed_name): Cast soffset_decode to int. 2004-01-27 Alexander Malmberg <alexander@malmberg.org> * selector.c: Rename register_selectors_from_list to __objc_register_selectors_from_list. Update caller. (__objc_register_selectors_from_list): Lock __objc_runtime_mutex while registering selectors. Use __sel_register_typed_name instead of sel_register_typed_name. Check for NULL method_name:s. (pool_alloc_selector): New function. (__sel_register_typed_name): Use pool_alloc_selector to allocate selector structures. * sendmsg.c (class_add_method_list): Use __objc_register_selectors_from_list. * objc/runtime.h: Add __objc_register_selectors_from_list. 2004-01-25 Adam Fedor <fedor@gnu.org> Nicola Pero <n.pero@mi.flashnet.it> Andrew Pinski <pinskia@physics.uc.edu> * objc/objc-decls.h: New file. * objc/objc-api.h (_objc_lookup_class): Mark as export. (_objc_load_callback): Likewise. (_objc_object_alloc): Likewise. (_objc_object_copy): Likewise. (_objc_object_dispose): Likewise. 2004-01-25 Andrew Pinski <pinskia@physics.uc.edu> * archive.c: s/__inline__/inline * sendmsg.c: Likewise. * encoding.c: Remove FIXME about the warning about unused variable. * sendmsg.c: Add a FIXME comment saying that this should be using libffi. * Makefile.in (LIBTOOL): Use @LIBTOOL@ now as it works. From-SVN: r82253
Diffstat (limited to 'libobjc/sendmsg.c')
-rw-r--r--libobjc/sendmsg.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c
index 0214e77afcd..f0b5bbb35c2 100644
--- a/libobjc/sendmsg.c
+++ b/libobjc/sendmsg.c
@@ -1,6 +1,6 @@
/* GNU Objective C Runtime message lookup
Copyright (C) 1993, 1995, 1996, 1997, 1998,
- 2001, 2002 Free Software Foundation, Inc.
+ 2001, 2002, 2004 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup
This file is part of GCC.
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
/* FIXME: This file has no business including tm.h. */
+/* FIXME: This should be using libffi instead of __builtin_apply
+ and friends. */
#include "tconfig.h"
#include "coretypes.h"
@@ -35,7 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "encoding.h"
#include "runtime-info.h"
-/* this is how we hack STRUCT_VALUE to be 1 or 0 */
+/* This is how we hack STRUCT_VALUE to be 1 or 0. */
#define gen_rtx(args...) 1
#define gen_rtx_MEM(args...) 1
#define gen_rtx_REG(args...) 1
@@ -83,7 +85,7 @@ Method_t search_for_method_in_list (MethodList_t list, SEL op);
id nil_method (id, SEL);
/* Given a selector, return the proper forwarding implementation. */
-__inline__
+inline
IMP
__objc_get_forward_imp (SEL sel)
{
@@ -115,7 +117,7 @@ __objc_get_forward_imp (SEL sel)
}
/* Given a class and selector, return the selector's implementation. */
-__inline__
+inline
IMP
get_imp (Class class, SEL sel)
{
@@ -176,7 +178,7 @@ get_imp (Class class, SEL sel)
/* Query if an object can respond to a selector, returns YES if the
object implements the selector otherwise NO. Does not check if the
method can be forwarded. */
-__inline__
+inline
BOOL
__objc_responds_to (id object, SEL sel)
{
@@ -201,7 +203,7 @@ __objc_responds_to (id object, SEL sel)
/* This is the lookup function. All entries in the table are either a
valid method *or* zero. If zero then either the dispatch table
needs to be installed or it doesn't exist and forwarding is attempted. */
-__inline__
+inline
IMP
objc_msg_lookup (id receiver, SEL op)
{
@@ -463,28 +465,14 @@ __objc_update_dispatch_table_for_class (Class class)
This one is only called for categories. Class objects have their
methods installed right away, and their selectors are made into
- SEL's by the function __objc_register_selectors_from_class. */
+ SEL's by the function __objc_register_selectors_from_class. */
void
class_add_method_list (Class class, MethodList_t list)
{
- int i;
-
/* Passing of a linked list is not allowed. Do multiple calls. */
assert (! list->method_next);
- /* Check for duplicates. */
- for (i = 0; i < list->method_count; ++i)
- {
- Method_t method = &list->method_list[i];
-
- if (method->method_name) /* Sometimes these are NULL */
- {
- /* This is where selector names are transmogrified to SEL's */
- method->method_name =
- sel_register_typed_name ((const char *) method->method_name,
- method->method_types);
- }
- }
+ __objc_register_selectors_from_list(list);
/* Add the methods to the class's method list. */
list->method_next = class->methods;
@@ -705,7 +693,7 @@ __objc_print_dtable_stats ()
/* Returns the uninstalled dispatch table indicator.
If a class' dispatch table points to __objc_uninstalled_dtable
then that means it needs its dispatch table to be installed. */
-__inline__
+inline
struct sarray *
objc_get_uninstalled_dtable ()
{