From patchwork Fri Jun 3 19:15:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 98630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0277AB6FB2 for ; Sat, 4 Jun 2011 05:16:05 +1000 (EST) Received: (qmail 1822 invoked by alias); 3 Jun 2011 19:16:03 -0000 Received: (qmail 1811 invoked by uid 22791); 3 Jun 2011 19:16:02 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL, BAYES_50, SARE_SUB_ENC_UTF8, TW_BJ, TW_CP, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Jun 2011 19:15:47 +0000 Received: from eggs.gnu.org ([140.186.70.92]:35671) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QSZqT-0008Pq-W9 for gcc-patches@gnu.org; Fri, 03 Jun 2011 15:15:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSZqQ-0004mw-D5 for gcc-patches@gnu.org; Fri, 03 Jun 2011 15:15:44 -0400 Received: from smtp161.iad.emailsrvr.com ([207.97.245.161]:41362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSZqP-0004mT-S8 for gcc-patches@gnu.org; Fri, 03 Jun 2011 15:15:42 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp26.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 062FAA8800 for ; Fri, 3 Jun 2011 15:15:40 -0400 (EDT) Received: from dynamic6.wm-web.iad.mlsrvr.com (dynamic6.wm-web.iad1a.rsapps.net [192.168.2.147]) by smtp26.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id E3FC4A87FA for ; Fri, 3 Jun 2011 15:15:39 -0400 (EDT) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic6.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id CC1E13F0054 for ; Fri, 3 Jun 2011 15:15:39 -0400 (EDT) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Fri, 3 Jun 2011 21:15:39 +0200 (CEST) Date: Fri, 3 Jun 2011 21:15:39 +0200 (CEST) Subject: =?utf-8?Q?libobjc=3A_remove_deprecated_API_=28patch_7=29?= From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain Message-ID: <1307128539.834222057@www2.webmail.us> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 207.97.245.161 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch removes another bunch of deprecated functions and hooks from libobjc, in particular objc_valloc(), the various _objc_alloc and similar hooks and the _objc_unexpected_exception hook. Committed to trunk. Thanks Index: Makefile.in =================================================================== --- Makefile.in (revision 174614) +++ Makefile.in (working copy) @@ -132,11 +132,8 @@ OBJC_DEPRECATED_H = \ Object.h \ Protocol.h \ objc_get_uninstalled_dtable.h \ - objc_malloc.h \ objc_msg_sendv.h \ objc_object_alloc.h \ - objc_unexpected_exception.h \ - objc_valloc.h \ struct_objc_category.h \ struct_objc_class.h \ struct_objc_ivar.h \ @@ -268,16 +265,14 @@ sendmsg_gc.lo: sendmsg.c runtime-info.h # These files have separate rules because they require special # compiler flags. -# -Wno-deprecated-declarations is to silence warnings from using -# _objc_unexpected_exception. exception.lo: exception.c $(LIBTOOL_COMPILE) $(CC) $< -c \ - $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \ + $(ALL_CFLAGS) $(INCLUDES) -fexceptions \ -o $@ exception_gc.lo: exception.c $(LIBTOOL_COMPILE) $(CC) $< -c \ - $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions -Wno-deprecated-declarations \ + $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions \ -o $@ doc: info dvi pdf html Index: libobjc.def =================================================================== --- libobjc.def (revision 174610) +++ libobjc.def (working copy) @@ -26,7 +26,6 @@ objc_get_uninstalled_dtable _objc_load_callback objc_malloc objc_atomic_malloc -objc_valloc objc_realloc objc_calloc objc_free @@ -36,7 +35,6 @@ objc_mutex_deallocate objc_mutex_lock objc_mutex_trylock objc_mutex_unlock -_objc_unexpected_exception objc_thread_detach objc_thread_exit objc_thread_get_data Index: exception.c =================================================================== --- exception.c (revision 174593) +++ exception.c (working copy) @@ -31,12 +31,6 @@ see the files COPYING3 and COPYING.RUNTIME respect #include "unwind-pe.h" #include /* For memcpy */ -/* This hook allows libraries to sepecify special actions when an - exception is thrown without a handler in place. This is deprecated - in favour of objc_set_uncaught_exception_handler (). */ -void (*_objc_unexpected_exception) (id exception); /* !T:SAFE */ - - /* 'is_kind_of_exception_matcher' is our default exception matcher - it determines if the object 'exception' is of class 'catch_class', or of a subclass. */ @@ -539,13 +533,6 @@ objc_exception_throw (id exception) (*__objc_uncaught_exception_handler) (exception); } - /* As a last resort support the old, deprecated way of setting an - uncaught exception handler. */ - if (_objc_unexpected_exception != 0) - { - (*_objc_unexpected_exception) (exception); - } - abort (); } Index: ChangeLog =================================================================== --- ChangeLog (revision 174614) +++ ChangeLog (working copy) @@ -1,5 +1,24 @@ 2011-06-03 Nicola Pero + * Makefile.in (OBJC_DEPRECATED_H): Removed objc_valloc.h, + objc_malloc.h and objc_unexpected_exception.h. + (exception.lo): Do not use -Wno-deprecated-declarations. + (exception_gc.lo): Likewise. + * objc/objc-api.h: Do not include deprecated/objc_valloc.h, + deprecated/objc_malloc.h and + deprecated/objc_unexpected_exception.h. + * objc/deprecated/objc_valloc.h: Removed. + * objc/deprecated/objc_malloc.h: Removed. + * objc/deprecated/objc_unexpected_exception.h: Removed. + * exception.c (_objc_unexpected_exception): Removed. + (objc_exception_throw): Do not check for + _objc_unexpected_exception. + * memory.c (objc_valloc, _objc_malloc, _objc_atomic_malloc, + _objc_valloc, _objc_realloc, _objc_calloc, _objc_free): Removed. + * libobjc.def (_objc_unexpected_exception, objc_valloc): Removed. + +2011-06-03 Nicola Pero + * objc/objc.h: Do not include deprecated/STR.h. * objc/deprecated/STR.h: Removed. * Makefile.in (OBJC_DEPRECATED_H): removed STR.h. Index: memory.c =================================================================== --- memory.c (revision 174593) +++ memory.c (working copy) @@ -133,38 +133,3 @@ objc_free (void *mem) } #endif /* !OBJC_WITH_GC */ - -/* The rest of the file contains deprecated code. */ - -#if OBJC_WITH_GC - -void * -objc_valloc (size_t size) -{ - void *res = (void *)(GC_malloc (size)); - if (! res) - _objc_abort ("Virtual memory exhausted\n"); - return res; -} - -#else - -void * -objc_valloc (size_t size) -{ - void *res = (void *)(malloc (size)); - if (! res) - _objc_abort ("Virtual memory exhausted\n"); - return res; -} - -#endif /* !OBJC_WITH_GC */ - -/* Hook functions for memory allocation and disposal. Deprecated and - currently unused. */ -void *(*_objc_malloc) (size_t) = malloc; -void *(*_objc_atomic_malloc) (size_t) = malloc; -void *(*_objc_valloc) (size_t) = malloc; -void *(*_objc_realloc) (void *, size_t) = realloc; -void *(*_objc_calloc) (size_t, size_t) = calloc; -void (*_objc_free) (void *) = free; Index: objc/deprecated/objc_malloc.h =================================================================== --- objc/deprecated/objc_malloc.h (revision 174593) +++ objc/deprecated/objc_malloc.h (working copy) @@ -1,17 +0,0 @@ -/* -** Hook functions for memory allocation and disposal. -** This makes it easy to substitute garbage collection systems -** such as Boehm's GC by assigning these function pointers -** to the GC's allocation routines. By default these point -** to the ANSI standard malloc, realloc, free, etc. -** -** Users should call the normal objc routines above for -** memory allocation and disposal within their programs. -*/ -objc_EXPORT void *(*_objc_malloc)(size_t); -objc_EXPORT void *(*_objc_atomic_malloc)(size_t); -objc_EXPORT void *(*_objc_valloc)(size_t); -objc_EXPORT void *(*_objc_realloc)(void *, size_t); -objc_EXPORT void *(*_objc_calloc)(size_t, size_t); -objc_EXPORT void (*_objc_free)(void *); - Index: objc/deprecated/objc_valloc.h =================================================================== --- objc/deprecated/objc_valloc.h (revision 174593) +++ objc/deprecated/objc_valloc.h (working copy) @@ -1,2 +0,0 @@ -void * -objc_valloc(size_t size); Index: objc/deprecated/objc_unexpected_exception.h =================================================================== --- objc/deprecated/objc_unexpected_exception.h (revision 174593) +++ objc/deprecated/objc_unexpected_exception.h (working copy) @@ -1,9 +0,0 @@ -/* -** Hook for uncaught exceptions. This hook is called when an -** exception is thrown and no valid exception handler is in place. -** The function is expected never to return. If the function returns -** the result is currently undefined. This is deprecated. Please use -** objc_set_uncaught_exception_handler() from objc/objc-exception.h -** instead. -*/ -objc_EXPORT void (*_objc_unexpected_exception)(id) __attribute__ ((deprecated)); Index: objc/objc-api.h =================================================================== --- objc/objc-api.h (revision 174610) +++ objc/objc-api.h (working copy) @@ -218,11 +218,6 @@ objc_calloc(size_t nelem, size_t size); objc_EXPORT void objc_free(void *mem); -#include "deprecated/objc_valloc.h" -#include "deprecated/objc_malloc.h" - -#include "deprecated/objc_unexpected_exception.h" - objc_EXPORT Method_t class_get_class_method(MetaClass _class, SEL aSel); objc_EXPORT Method_t class_get_instance_method(Class _class, SEL aSel);