diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-12-11 19:43:21 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-12-11 19:43:21 +0000 |
commit | e97cfd97070b27823e55d717b802c4bc95954104 (patch) | |
tree | c50ecdee614fbdc518483d8012362f18adfbe922 /libobjc/objc | |
parent | 375d1239a479316e3fc806708477b98b076673e8 (diff) | |
download | gcc-e97cfd97070b27823e55d717b802c4bc95954104.zip gcc-e97cfd97070b27823e55d717b802c4bc95954104.tar.gz gcc-e97cfd97070b27823e55d717b802c4bc95954104.tar.bz2 |
In libobjc/: 2010-12-11 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-11 Nicola Pero <nicola.pero@meta-innovation.com>
* sendmsg.c (selector_resolveClassMethod): New.
(selector_resolveInstanceMethod): New.
(__objc_resolve_class_method): New.
(__objc_resolve_instance_method): New.
(get_imp): Call __objc_resolve_class_method or
__objc_resolve_instance_method at the appropriate time.
(objc_msg_lookup): Same.
(class_getClassMethod): Same.
(class_getInstanceMethod): Same.
(__objc_init_dispatch_tables): Initialize
selector_resolveClassMethod and selector_resolveInstanceMethod.
* objc/runtime.h: Updated documentation of class_getClassMethod,
class_getInstanceMethod and class_getMethodImplementation.
In gcc/testsuite/:
2010-12-11 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-resolve-method.m: New.
* obj-c++.dg/gnu-api-2-resolve-method.mm: New.
From-SVN: r167712
Diffstat (limited to 'libobjc/objc')
-rw-r--r-- | libobjc/objc/runtime.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h index b37eee2..f5df691 100644 --- a/libobjc/objc/runtime.h +++ b/libobjc/objc/runtime.h @@ -590,13 +590,17 @@ objc_disposeClassPair (Class class_); /* Return the instance method with selector 'selector' of class 'class_', or NULL if the class (or one of its superclasses) does not implement the method. Return NULL if class_ is Nil or selector - is NULL. */ + is NULL. Calling this function may trigger a call to + +resolveInstanceMethod:, but does not return a forwarding + function. */ objc_EXPORT Method class_getInstanceMethod (Class class_, SEL selector); /* Return the class method with selector 'selector' of class 'class_', or NULL if the class (or one of its superclasses) does not implement the method. Return NULL if class_ is Nil or selector is - NULL. */ + NULL. Calling this function may trigger a call to + +resolveClassMethod:, but does not return a forwarding + function. */ objc_EXPORT Method class_getClassMethod (Class class_, SEL selector); /* Return the IMP (pointer to the function implementing a method) for @@ -607,7 +611,15 @@ objc_EXPORT Method class_getClassMethod (Class class_, SEL selector); arguments and return type before calling it. To get a class method, you can pass the meta-class as the class_ argument (ie, use class_getMethodImplementation (object_getClass (class_), - selector)). Return NULL if class_ is Nil or selector is NULL. */ + selector)). Return NULL if class_ is Nil or selector is NULL. + This function first looks for an existing method; if it is not + found, it calls +resolveClassMethod: or +resolveInstanceMethod: + (depending on whether a class or instance method is being looked + up) if it is implemented. If the method returns YES, then it tries + the look up again (the assumption being that +resolveClassMethod: + or resolveInstanceMethod: will add the method using + class_addMethod()). If it is still not found, it returns a + forwarding function. */ objc_EXPORT IMP class_getMethodImplementation (Class class_, SEL selector); /* Compatibility Note: the Apple/NeXT runtime has the function |