In gcc/:
2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented fast enumeration for Objective-C.
* c-parser.c (objc_could_be_foreach_context): New.
(c_lex_one_token): Recognize RID_IN keyword in a potential
Objective-C foreach context.
(c_parser_declaration_or_fndef): Added parameter. Accept
Objective-C RID_IN keyword as terminating a declaration; in that
case, return the declaration in the new parameter.
(c_parser_extenral_declaration): Updated calls to
c_parser_declaration_or_fndef.
(c_parser_declaration_or_fndef): Same change.
(c_parser_compound_statement_nostart): Same change.
(c_parser_label): Same change.
(c_parser_objc_methodprotolist): Same change.
(c_parser_omp_for_loop): Same change.
(c_parser_for_statement): Detect and parse Objective-C foreach
statements.
(c_parser_omp_for_loop): Updated call to check_for_loop_decls().
* c-decl.c (check_for_loop_decls): Added parameter to allow ObjC
fast enumeration parsing code to turn off the c99 error but still
perform checks on the loop declarations.
* c-tree.h (check_for_loop_decls): Updated declaration.
* doc/objc.texi: Document fast enumeration.
In gcc/c-family/:
2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented fast enumeration for Objective-C.
* c-common.h (objc_finish_foreach_loop): New.
* stub-objc.c (objc_finish_foreach_loop): New.
In gcc/objc/:
2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented fast enumeration for Objective-C.
* objc-act.c (build_fast_enumeration_state_template): New.
(TAG_ENUMERATION_MUTATION): New.
(TAG_FAST_ENUMERATION_STATE): New.
(synth_module_prologue): Call build_fast_enumeration_state_template() and set up
objc_enumeration_mutation_decl.
(objc_create_temporary_var): Allow providing a name to temporary
variables.
(objc_build_exc_ptr): Updated calls to
objc_create_temporary_var().
(next_sjlj_build_try_catch_finally): Same change.
(objc_finish_foreach_loop): New.
* objc-act.h: Added OCTI_FAST_ENUM_STATE_TEMP,
OCTI_ENUM_MUTATION_DECL, objc_fast_enumeration_state_template,
objc_enumeration_mutation_decl.
Merge from 'apple/trunk' branch on FSF servers.
2006-04-12 Fariborz Jahanian <fjahanian@apple.com>
Radar 4507230
* objc-act.c (objc_type_valid_for_messaging): New routine to check
for valid objc object types.
(objc_finish_foreach_loop): Check for invalid objc objects in
foreach header.
In gcc/testsuite/:
2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented fast enumeration for Objective-C.
* objc.dg/foreach-1.m: New.
* objc.dg/foreach-2.m: New.
* objc.dg/foreach-3.m: New.
* objc.dg/foreach-4.m: New.
* objc.dg/foreach-5.m: New.
* objc.dg/foreach-6.m: New.
* objc.dg/foreach-7.m: New.
Merge from 'apple/trunk' branch on FSF servers:
2006-04-13 Fariborz Jahanian <fjahanian@apple.com>
Radar 4502236
* objc.dg/objc-foreach-5.m: New.
2006-04-12 Fariborz Jahanian <fjahanian@apple.com>
Radar 4507230
* objc.dg/objc-foreach-4.m: New.
2006-03-13 Fariborz Jahanian <fjahanian@apple.com>
Radar 4472881
* objc.dg/objc-foreach-3.m: New.
2005-03-07 Fariborz Jahanian <fjahanian@apple.com>
Radar 4468498
* objc.dg/objc-foreach-2.m: New.
2006-02-15 Fariborz Jahanian <fjahanian@apple.com>
Radar 4294910
* objc.dg/objc-foreach-1.m: New
In libobjc/:
2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented fast enumeration for Objective-C.
* Makefile.in (C_SOURCE_FILES): Added objc-foreach.c.
(OBJC_H): Added runtime.h
* objc-foreach.c: New file.
* objc/runtime.h: New file.
From-SVN: r165019
In gcc/:
2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
* doc/objc.texi (Type encoding): Added the new 'long double' (D)
code. Added byref, which was missing in the list of codes.
Explain that enumeration values are encoded as the integer type
that the compiler uses to store them. Explain and make examples
of how 'const' interacts with pointers, and the complication of
the encoding of 'const char *'.
(Legacy type encoding): New subsection, explaining that GCC emits
incorrect type encodings for the NeXT runtime for compatibility
reasons.
(@@encode): New subsection, explaining @encode and particularly
that protocol qualifiers are not recognized inside an @encode()
expression.
(Method signatures): New subsection, explaining how method
signatures are encoded.
In gcc/objc/:
2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/45763
PR objc/25450
PR objc/25464
* objc-act.c: Improved comments for encoding functions.
(encode_aggregate_within): For the GNU runtime, rewritten some
obsfuscated code to clarify the various cases.
(encode_aggregate): Function removed.
(encode_array): Generate an error if asked to encode an incomplete
array as part of generating instance variables. Else, when
encoding an incomplete array inside a structure, encode it as an
array of zero size.
(encode_pointer): For the GNU runtime, fixed encoding 'BOOL *' as
'^c' instead of '*'.
(encode_gnu_bitfield): Encode enumerated types exactly in the same
type as integer types instead of using a hardcoded 'i'. If asked
to encode a non-integer type as a bitfield, do not abort
compilation immediately; instead generate an error, then skip the
type.
(encode_type): Use a 'switch' instead of a sequence of 'if's.
Added a 'default' clause that gets executed if the type can not be
matched, and that encodes it as '?' (unknown) and produces a
warning. For the GNU runtime, encode enumerated types exactly in
the same way as integer types instead of using a hardcoded 'i'.
Encode long double as 'D'. Encode 128-bit integers as 'T' or 't'.
Encode C++ reference types as pointers. Call encode_vector to
encode vectors.
(encode_vector): New function.
2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
Merge from 'apple/trunk' branch on FSF servers. I modified the
changes to be used only when compiling for the NeXT runtime.
2005-10-10 Fariborz Jahanian <fjahanian@apple.com>
Radar 4301047
* objc-act.c (encode_type): Remove the hack.
2005-07-20 Ziemowit Laski <zlaski@apple.com>
Radar 4136935
* objc-act.c (pointee_is_readonly): New function.
(encode_pointer, encode_aggregate_within, encode_type):
Attempt to emulate GCC 3.3 when generating type encodings.
In gcc/testsuite/:
2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/25464
* objc.dg/type-size-3.m: New test.
2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/45763
* objc.dg/encode-1.m: Execute the test with the GNU runtime as
well.
2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/25450
* objc.dg/encode-3.m: Updated for fix of encoding of enums.
* objc.dg/type-size-2.m: Same change.
* obj-c++.dg/encode-5.mm: Same change.
2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
Merge from 'apple/trunk' branch on FSF servers. The original
Changelogs are below.
* objc.dg/encode-6.m: Execute the test only with the GNU runtime.
* objc.dg/encode-6-next.m: New file (from encode-6.m in the
branch).
* objc.dg/encode-7-next.m: New file (from encode-7.m in the
branch).
* objc.dg/encode-7-next-64bit.m: New file (from encode-7-64bit.m
in the branch).
* objc.dg/proto-qual-1.m: Test the 3.3 ABI on NeXT (from
proto-qual-1.m in the branch) and the normal ABI on GNU.
* objc.dg/threedotthree-abi-1.m: New file (from the branch). Run
the test only with the NeXT runtime.
* obj-c++/encode-1.mm: Execute the test only with the GNU runtime.
* obj-c++/encode-1-next.mm: New file (from encode-1.mm in the
branch).
* obj-c++.dg/threedotthree-abi-1.mm: New file (from the branch).
Run the test only with the NeXT runtime.
2006-03-30 Fariborz Jahanian <fjahanian@apple.com>
Radar 4492973
* objc.dg/encode-7-64bit.m: New.
* objc.dg/encode-7.m: Skip if -m64.
2005-10-19 Fariborz Jahanian <fjahanian@apple.com>
Radar 4301047
* objc.dg/proto-qual-1.m: Fix test to match 3.3 ABI
* obj-c++.dg/threedotthree-abi-1.mm: New
* objc.dg/threedotthree-abi-1.m: New
2005-07-20 Ziemowit Laski <zlaski@apple.com>
Radar 4136935
* obj-c++.dg/encode-1.mm: Tweak encodings to match fix.
* objc.dg/encode-6.m: Likewise.
* objc.dg/encode-7.m: New test case.
In libobjc/:
2010-09-26 Nicola Pero <nicola.pero@meta-innovation.com>
* encoding.c (objc_sizeof_type): Added support for vector type and
for double long types.
(objc_alignof_type): Same change.
(objc_skip_typespec): Same change.
* objc/encoding.h (_C_GCINVISIBLE): Use '|' for _C_GCINVISIBLE
instead of '!' since '!' is already used for _C_VECTOR.
* objc/objc-api.h (_C_LNG_DBL): Added.
From-SVN: r164659
* hash.c: Include objc-private/hash.h instead of objc/hash.h.
* objc/sarray.h: Moved into objc/deprecated/sarray.h;
objc/sarray.h replaced with a placeholder including the file from
the deprecated/ directory.
* objc-private/sarray.h: New file (private copy of sarray.h).
* hash.c: Include <assert.h> instead of "assert.h"
* sarray.c: Include <assert.h> instead of "assert.h". Include
objc-private/sarray.h instead of objc/sarray.h.
* selector.c: Include objc-private/sarray.h instead of
objc/sarray.h.
* sendmsg.c: Include <assert.h>. Include objc-private/sarray.h
instead of objc/sarray.h.
* Makefile.in (OBJC_DEPRECATED_H): Added sarray.h.
From-SVN: r164389
* objc-private/objc-list.h (list_remove_elem): Unused function
removed. (list_nth): Unused function removed. (list_find):
Unused function removed. (list_lenght): Unused function removed.
Also, fixed an error in my last commit by adding back
objc/hash.h and objc/objc-list.h that had not been committed.
From-SVN: r164374
* objc/hash.h: Moved into objc/deprecated/hash.h; objc/hash.h
replaced with a placeholder including the file from the
deprecated/ directory.
* objc/objc-api.h: Updated includes.
* objc/typedstream.h: Updated includes.
* objc-private/hash.h: New file (private copy of hash.h).
* objc/objc-list.h: Moved into objc/deprecated/objc-list.h;
objc/objc-list.h replaced with a placeholder including the file
from the deprecated/ directory.
* objc-private/objc-list.h: New file (private copy of objc-list.h).
* init.c: Include objc-private/hash.h and objc-private/objc-list.h
instead of objc/hash.h and objc/objc-list.h.
* selector.c: Same change.
* class.c: Added include <string.h>, which used to be implicitly included
when hash.h was included.
* exception.c: Same change.
* objects.c: Same change.
* sarray.c: Same change.
* sendmsg.c: Same change.
* Makefile.in (OBJC_DEPRECATED_H): Added hash.h and objc-list.h.
(OBJC_H): Removed hash.h and objc-list.h
From-SVN: r164373
In libobjc/:
Implemented objc_sync_enter() and objc_sync_exit(), which are
required by @synchronized() to work.
* objc-sync.c: New file.
* objc/objc-sync.h: New file.
* objc-private/objc-sync.h: New file.
* init.c (__objc_exec_class): Call __objc_sync_init() during the
Objective-C runtime startup.
* Makefile.in: Added objc-sync.c and objc-sync.h.
* configure.ac: Added GCC_CHECK_TLS.
* acinclude.m4: Include ../config/enable.m4 and ../config/tls.m4.
* configure: Regenerated.
* config.h.in: Regenerated.
From-SVN: r164276
* Makefile.in (%_gc.lo): New pattern rules to build the
garbage-collected version of the library. Removed rules for
specific files that are no longer needed. Standardized all rules.
(C_SOURCE_FILES, OBJC_SOURCE_FILES): New variables.
(OBJS, OBJS_GC): Compute these from C_SOURCE_FILES and
OBJC_SOURCE_FILES.
(INCLUDES): Removed the unused include -I$(srcdir)/objc.
* memory.c (objc_calloc): Fixed call to GC_malloc when building
with Garbage Colletion.
From-SVN: r164231
* objc/deprecated/objc_malloc.h: New file.
* objc/deprecated/objc_valloc.h: New file.
* objc/objc-api.h: Include the files instead of defining
objc_valloc, _objc_malloc() and similar.
* Makefile.in (OBJC_DEPRECATED_H): Added objc_valloc.h and
objc_malloc.h.
* memory.c: Removed the extra layer of indirection of _objc_malloc
and similar.
(objc_calloc): Use GC_malloc in the garbage-collected
implementation as GC_malloc returns memory that is already freed.
(objc_valloc): Deprecated.
From-SVN: r164224
* objc/deprecated/objc_error.h: New file.
* objc/objc-api.h: Include deprecated/objc_error.h instead of
defining objc_error and related.
* error.c: New file. Added _objc_abort function which replaces
objc_error. No change in functionality as they both print an
error and abort.
* misc.c: File removed. Code moved into memory.c and error.c.
* memory.c: New file.
* objc-private/error.h: New file.
* archive.c: Include objc-private/error.h and use _objc_abort
instead of objc_error everywhere.
* class.c: Same change.
* encoding.c: Same change.
* init.c: Same change, and simplified init_check_module_version.
* memory.c: Same change.
* sendmsg.c: Same change.
* thr.c: Same change.
* Makefile.in (OBJ_DEPRECATED_H): Added objc_error.h.
(OBJ_H): Reordered list.
(OBJS): Removed misc.lo, added memory.lo and error.lo.
(OBJS_GC): Removed misc_gc.lo, added memory_gc.lo and error_gc.lo.
(misc_gc.lo): Rule removed.
(error_gc.lo): Rule added.
(memory_gc.lo): Rule added.
From-SVN: r164223
* objc/objc.h (__GNU_LIBOBJC__): New #define providing an easy way
to check the API version. Added some comments.
* objc-private/common.h: New file.
* NXConstStr.m: Include objc-private/common.h.
* Object.m: Same change.
* Protocol.m: Same change.
* archive.c: Same change.
* class.c: Same change.
* encoding.c: Same change.
* exception.c: Same change.
* gc.c: Same change.
* hash.c: Same change.
* init.c: Same change.
* libobjc_entry.c: Same change.
* linking.m: Same change.
* misc.c: Same change (and added a comment).
* nil_method.c: Same change.
* objects.c: Same change.
* sarray.c: Same change.
* selector.c: Same change.
* sendmsg.c: Same change.
* thr.c: Same change.
From-SVN: r164218
* archive.c: Removed not needed includes.
* class.c: Same change.
* hash.c: Same change.
* misc.c: Same change.
* nil_method.c: Same change.
* objects.c: Same change.
* sarray.c: Same change.
* sendmsg.c: Same change.
* thr.c: Same change.
From-SVN: r164214
* objc/runtime.h: Moved to objc-private/runtime.h. Do not include
all the objc/*.h files.
* objc-private/runtime.h: New file.
* archive.c: Include objc-private/runtime.h (and required objc/*.h
files) instead of objc/runtime.h.
* class.c: Same change.
* hash.c: Same change.
* init.c: Same change.
* misc.c: Same change.
* nil_method.c: Same change.
* objects.c: Same change.
* sarray.c: Same change.
* selector.c: Same change.
* sendmsg.c: Same change.
* thr.c: Same change.
From-SVN: r164213
* objc/deprecated/struct_objc_selector.h: New file. Definition of
'struct objc_selector' and 'sel_eq' moved here.
* objc/deprecated/struct_objc_protocol.h: New file. Definition of
'struct objc_procotol' moved here.
* objc/deprecated/struct_objc_class.h: New file. Definition of
'struct objc_class' moved here.
* objc/deprecated/MetaClass.h: New file. Definition of MetClass
moved here.
* objc/deprecated/STR.h: New file. Definition of STR moved here.
* objc/message.h: New file. Definitions for relval_t, apply_t,
arglist, arglist_t and objc_msg_lookup were moved here.
* objc/objc.h: Include the above files instead of defining the
corresponding structs, types and functions here. Added new opaque
definitions for SEL and Class. Use Class and not 'struct
objc_class *' in the definition of 'struct objc_object'.
Commented all types defined in the file. Removed special
definition of BOOL as 'int' on __vxworks; use 'unsigned char'
there as well.
* objc/deprecated/objc-unexpected-exception.h: Renamed to
objc_unexpected_exception.h.
* objc/objc-api.h: Updated include of
objc-unexpetected-exception.h
* objc/objc-exception.h: Updated comments.
* Makefile.in (OBJC_H, OBJC_DEPRECATED_H): Added the new header
files. Reindented list of files.
From-SVN: r164212
* libobjc/objc/deprecated: New directory.
* libobjc/objc/deprecated/README: New file.
* libobjc/objc/README: New file.
* libobjc/objc/typedstream.h: Moved into objc/deprecated/typedstream.h;
objc/typedstream.h replaced with a placeholder including the file
from the deprecated/ directory.
* libobjc/objc/deprecated/objc-unexpected-exception.h: New file with the
definition of _objc_unexpected_exception.
* libobjc/objc/objc-api.h: Include deprecated/objc-unexcepted-exception.h
instead of defining _objc_unexpected_exception.
* libobjc/objc/deprecated/Object.h: New file with the deprecated Object
methods in a 'Deprecated' category.
* libobjc/objc/Object.h Include deprecated/Object.h instead of defining
the deprecated methods.
* libobjc/Object.m: Moved deprecated methods into 'Deprecated' category.
* libobjc/objc-private: New directory.
* libobjc/objc-private/README: New file.
* libobjc/Makefile.in (OBJC_DEPRECATED_H): New variable.
(install-headers): Create installation directory for
OBJC_DEPRECATED_H headers, and install them.
From-SVN: r164153
* objc/objc-exception.h: New file.
* exception.c (objc_set_uncaught_exception_handler): Implemented.
(objc_set_exception_matcher): Implemented.
(objc_exception_throw): Use the uncaught exception handler if set.
(PERSONALITY_FUNCTION): Use the exception matcher instead of the
hardcoded isKindOf.
(isKindOf): Renamed to is_kind_of_exception_matcher. Tidied code
up. Removed segmentation fault when value is 'nil'.
* objc/objc-api.h (_objc_unexpected_exception): Mark as
deprecated.
* Makefile.in (exception.lo, exception_gc.lo): Use
-Wno-deprecated-declarations when compiling.
(OBJC_H): Added objc-exception.h
From-SVN: r164023
* objc/typedstream.h: Deprecate all functions in the file. This
file is obsolete.
* objc/Object.h ([+streamVersion:], [-read:], [-write:],
[-awake]): Documented that these methods are deprecated. Added a
brief description of the Object class and its relationship to the
NSObject class.
* Makefile.in: Compile archive.c and Object.m with
-Wno-deprecated-declarations.
From-SVN: r164015
fixincludes/
* Makefile.in (AUTOCONF, AUTOHEADER, ACLOCAL, ACLOCAL_AMFLAGS):
New variables.
($(srcdir)/configure, $(srcdir)/config.h.in, $(srcdir)/aclocal.m4):
Use them.
gcc/
* Makefile.in (AUTOCONF, ACLOCAL, ACLOCAL_AMFLAGS, aclocal_deps):
New variables.
($(srcdir)/configure, $(srcdir)/aclocal.m4): New rules.
(AUTOHEADER): New variable.
($(srcdir)/cstamp-h.in): Use it.
gnattools/
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure): Use them.
libada/
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure)): Use them. Also depend on multi.m4.
libgcc/
* configure.ac: Add snippet for maintainer-mode.
* configure: Regenerate.
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure)): New rule, active only with maintainer
mode turned on.
libiberty/
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure): New rule, active only in maintainer mode.
libobjc/
* Makefile.in (AUTOCONF, ACLOCAL, ACLOCAL_AMFLAGS, aclocal_deps):
New variables.
($(srcdir)/configure, $(srcdir)/aclocal.m4): New rules.
intl/
* Makefile.in (aclocal_deps): New variable.
($(srcdir)/aclocal.m4): Use it, for portable makefile syntax.
libdecnumber/
* Makefile.in (aclocal_deps): New variable.
($(srcdir)/aclocal.m4): Use it, for portable makefile syntax.
From-SVN: r150277
2008-11-21 Kai Tietz <kai.tietz@onevision.com>
* Object.m (errno): Replaced by errno.h include.
(compare): Cast self to id to prevent warning on comparison.
* objc/objc.h (BOOL): Prevent redeclaration of BOOL, if it is
already there.
* sendmsg.c (__objc_print_dtable_stats): Remove type warnings.
* thr-win32.c (__objc_thread_detach): Remove type warning.
(__objc_thread_id): Likewise.
* thr.c (__objc_thread_detach_functiont): Add __builtin_trap ()
for noreturn.
From-SVN: r142087
2008-06-14 Kai Tietz <kai.tietz@onevision.com>
* exception.c (PERSONALITY_FUNCTION): Remove extra decrement
if HAVE_GETIPINFO is not defined.
From-SVN: r136782
2008-06-10 Kai Tietz <kai.tietz@onevision.com>
* Object.m (compare): Add type id.
* objc/Object.h: Likewise.
* archive.c (objc_read_class): Use size_t to extend version to be
size of pointer scalar width.
* sendmsg.c (rtx): Undefine it before redefinition.
(__objc_print_dtable_stats): Cast arguments to long as intended.
From-SVN: r136617
* configure.ac (arm*-*-linux-gnueabi): Don't disable building
of libobjc for ARM EABI Linux.
* configure: Regenerate.
libobjc/
* exception.c (__objc_exception_class): Initialise as constant
array for ARM EABI. Change macro to static const for non-ARM EABI.
(ObjcException): Add note about structure layout. Remove landingPad
and handlerSwitchValue for ARM EABI.
(get_ttype_entry): Add __ARM_EABI_UNWINDER__ version
of function.
(CONTINUE_UNWINDING): Define for ARM EABI/otherwise cases.
(PERSONALITY_FUNCTION): Use ARM EABI-specific arguments, and add
ARM EABI unwinding support.
(objc_exception_throw): Use memcpy to initialise exception class.
From-SVN: r136215