From d408c5dad6a60c641458957794429e9f226ce857 Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Mon, 12 Apr 1993 15:44:02 +0000 Subject: [PATCH] (__objc_init_install_dtable, __objc_install_dtable_for_class): Call to __objc_resolve_class_links moved to the latter. From-SVN: r4093 --- gcc/objc/sendmsg.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gcc/objc/sendmsg.c b/gcc/objc/sendmsg.c index 90688a5d008..301313d9f47 100644 --- a/gcc/objc/sendmsg.c +++ b/gcc/objc/sendmsg.c @@ -77,6 +77,12 @@ get_imp (Class_t class, SEL sel) #endif } +__inline__ BOOL +__objc_responds_to (id object, SEL sel) +{ + return get_imp (object->class_pointer, sel) != __objc_missing_method; +} + /* This is the lookup function. All entries in the table are either a valid method *or* one of `__objc_missing_method' which calls forward:: etc, or `__objc_init_install_dtable' which installs the @@ -139,11 +145,6 @@ static void __objc_init_install_dtable(id receiver, SEL op) void* args; void* result; - /* If the class has not yet had it's class links resolved, we must - re-compute all class links */ - if(!CLS_ISRESOLV(receiver->class_pointer)) - __objc_resolve_class_links(); - /* This may happen, if the programmer has taken the address of a method before the dtable was initialized... too bad for him! */ if(receiver->class_pointer->dtable != __objc_uninstalled_dtable) @@ -232,10 +233,17 @@ static void __objc_install_dispatch_table_for_class (Class_t class) { #ifdef OBJC_SPARSE_LOOKUP - Class_t super = class->super_class; + Class_t super; MethodList_t mlist; int counter; + /* If the class has not yet had it's class links resolved, we must + re-compute all class links */ + if(!CLS_ISRESOLV(class)) + __objc_resolve_class_links(); + + super = class->super_class; + if (super != 0 && (super->dtable == __objc_uninstalled_dtable)) __objc_install_dispatch_table_for_class (super); -- 2.30.2