public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libobjc: remove deprecated API (patch 4)
@ 2011-06-03 17:02 Nicola Pero
  0 siblings, 0 replies; only message in thread
From: Nicola Pero @ 2011-06-03 17:02 UTC (permalink / raw)
  To: gcc-patches

This patch removes -forward:: from Object.  I was planning to do this later, but the
previous patch (patch 3) removed -doesNotRecognize:, which was used in the default
implementation of -forward::, which generates some ugly warnings when compiling.  
Removing -forward:: removes the warnings.

Please note that at this stage the runtime may still invoke -forward:: if you have it 
implemented in your own class, and have not installed a custom forwarding routine.  
There are testcases in the GCC testsuite that test this.  This will all go away later, 
and will require removing the testcases, but at the same time I'd like to add new 
testcases for __objc_msg_forward and __objc_msg_forward2, which are the actual hooks 
used in practice by users of libobjc, but which currently are not really tested.

For now, this patch just removes [Object -forward::], which is deprecated, and makes 
libobjc compile again without warnings.

Committed to trunk.

Thanks

Index: sendmsg.c
===================================================================
--- sendmsg.c   (revision 174593)
+++ sendmsg.c   (working copy)
@@ -936,9 +936,12 @@ __objc_block_forward (id rcv, SEL op, ...)
 }
 
 
-/* This function is installed in the dispatch table for all methods
-   which are not implemented.  Thus, it is called when a selector is
-   not recognized.  */
+/* This function is called for methods which are not implemented,
+   unless a custom forwarding routine has been installed.  Please note
+   that most serious users of libobjc (eg, GNUstep base) do install
+   their own forwarding routines, and hence this is never actually
+   used.  But, if no custom forwarding routine is installed, this is
+   called when a selector is not recognized.  */
 static retval_t
 __objc_forward (id object, SEL sel, arglist_t args)
 {
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 174594)
+++ ChangeLog   (working copy)
@@ -1,5 +1,11 @@
 2011-06-03  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       * Object.m ([-forward::]): Removed.
+       * objc/deprecated/Object.h ([-forward::]): Removed.
+       * sendmsg.c (__objc_forward): Updated comments.
+       
+2011-06-03  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        * Makefile.in (OBJC_H): Removed objc-list.h.
        (OBJC_DEPRECATED_H): Removed objc-list.h.
        * objc/objc-list.h: File removed.
Index: Object.m
===================================================================
--- Object.m    (revision 174593)
+++ Object.m    (working copy)
@@ -248,12 +248,6 @@ see the files COPYING3 and COPYING.RUNTIME respect
             :class_get_class_method(self->isa, aSel)));
 }
 
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame
-{
-  (void) argFrame; /* UNUSED */
-  return (retval_t)[self doesNotRecognize: aSel];
-}
-
 - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame
 {
   return objc_msg_sendv(self, aSel, argFrame);
Index: objc/deprecated/Object.h
===================================================================
--- objc/deprecated/Object.h    (revision 174593)
+++ objc/deprecated/Object.h    (working copy)
@@ -49,7 +49,6 @@
 - (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
 
 /* Forwarding */
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
 - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
 
 /* Posing */



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-03 17:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-03 17:02 libobjc: remove deprecated API (patch 4) Nicola Pero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).