In libobjc/:
2011-08-06 Nicola Pero <nicola.pero@meta-innovation.com>
PR libobjc/49882
* class.c (class_getSuperclass): Return the superclass if the
class is in construction.
* objc/runtime.h (class_getSuperclass): Updated documentation.
In gcc/testsuite/:
2011-08-06 Nicola Pero <nicola.pero@meta-innovation.com>
PR libobjc/49882
* objc.dg/gnu-api-2-class.m (main): Test class_getSuperclass()
with classes that are in construction.
From-SVN: r177505
In libobjc/:
2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com>
Removed the Traditional Objective-C runtime public API.
* Makefile.in (OBJC_DEPRECATED_H): Variable removed.
(install-headers): Do not create the objc/deprecated directory and
do not install the deprecated headers.
(OBJC_H): Removed encoding.h and objc-api.h.
* Object.m: Removed all methods with the exception of -class and
-isEqual:. Updated includes. ([-class]): Use Modern API.
* objc/Object.h: Do not include deprecated/Object.h.
* objc/deprecated/Object.h: Removed.
* linking.m (__objc_linking): Call [Object class] instead of
[Object name].
* Protocol.m: Removed all methods with the exception of -isEqual:.
Updated includes.
* objc/Protocol.h: Do not include deprecated/Protocol.h.
* objc/deprecated/Protocol.h: Removed.
* objc/deprecated/struct_objc_symtab.h: Removed.
* objc/deprecated/struct_objc_module.h: Removed.
* objc/deprecated/struct_objc_ivar.h: Removed.
* objc/deprecated/struct_objc_ivar_list.h: Removed.
* objc/deprecated/struct_objc_method.h: Removed.
* objc/deprecated/struct_objc_method_list.h: Removed.
* objc/deprecated/struct_objc_protocol_list.h: Removed.
* objc/deprecated/struct_objc_category.h: Removed.
* objc/deprecated/MetaClass.h: Removed.
* objc/deprecated/objc_msg_sendv.h: Removed.
* objc/deprecated/README: Removed.
* objc/deprecated/struct_objc_class.h: Removed.
* objc/deprecated/struct_objc_protocol.h: Removed.
* objc/deprecated/struct_objc_selector.h: Removed.
* objc/encoding.h: Removed.
* objc/message.h (struct objc_super): Removed the definition for
the Traditional Objective-C runtime API.
* objc/objc.h: Do not include objc/objc-decls.h.
deprecated/struct_objc_selector.h, deprecated/MetaClass.h,
deprecated/struct_objc_class.h, deprecated/struct_objc_protocol.h
and deprecated/objc_msg_sendv.h. Uncommented new definition of
Protocol *.
* objc/objc-api.h: Removed.
* objc/runtime.h: Updated comments. Removed check to detect
concurrent usage of Traditional and Modern APIs.
* objc-private/module-abi-8.h: Always define struct objc_class and
struct objc_protocol. (struct objc_protocol_list): Changed type
of 'list' argument from 'Protocol *' to 'struct objc_protocol *'.
(class_get_instance_size): Added.
* objc-private/protocols.h (__objc_protocols_add_protocol): Take a
'struct objc_protocol *' as argument, not a 'Protocol *'.
* objc-private/runtime.h: Updated comments.
* objc-private/selector.h (struct objc_selector, sel_eq): Added.
* class.c: Include objc-private/selector.h.
(objc_get_meta_class): Return a Class instead of a MetaClass.
* encoding.c (method_get_next_argument): Removed.
(method_get_first_argument): Removed.
(method_get_nth_argument): Removed.
* gc.c: Include objc/runtime.h instead of objc/encoding.h.
Include objc-private/module-abi-8.h and ctype.h.
* protocols.c (__objc_protocols_add_protocol): Take a 'struct
objc_protocl *' as argument, not a 'Protocol *'.
(class_addProtocol): Added casts to 'struct objc_protocol *' and
'Protocol *'.
(class_copyProtocolList): Likewise.
(protocol_conformsToProtocol): Likewise.
(protocol_copyProtocolList): Likewise.
* sarray.c: Include objc-private/module-abi-8.h.
* sendmsg.c (method_get_next_argument): Removed.
(method_get_first_argument): Removed.
(method_get_nth_argument): Removed.
(objc_msg_sendv): Removed.
(arglist_t, retval_t): New. (class_get_class_method): Take a
'Class', not 'MetaClass', argument.
* thr.c: Include module-abi-8.h.
From-SVN: r174765
In libobjc/:
2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com>
* selector.c (sel_getTypedSelector): Return NULL if there are
multiple selectors with conflicting types.
* objc/runtime.h (sel_getTypedSelector): Updated documentation.
In gcc/testsuite/:
2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-sel.m: Test that sel_getTypedSelector return
NULL in case of a selector with conflicting types.
* obj-c++.dg/gnu-api-2-sel.mm: Same change.
From-SVN: r170563
In libobjc/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* selector.c (sel_getTypedSelector): Return NULL if given a NULL
argument.
(sel_registerTypedName): Same.
(sel_registerName): Same.
* objc/runtime.h: Updated documentation.
In gcc/testsuite/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-sel.m: Test calling sel_getUid,
sel_registerName and sel_registerTypedName with NULL arguments.
Updated the test to work with the Apple runtime as well.
* obj-c++.dg/gnu-api-2-sel.mm: Same change.
From-SVN: r168231
In libobjc/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/runtime.h (class_addIvar): Updated documentation. The
alignment is actually the log_2 of the alignment in bytes.
* ivars.c (class_addIvar): Corresponding change to the
implementation.
In gcc/testsuite/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-class.m: Updated test to pass log_2 of the
alignment to class_addIvar, instead of the alignment itself.
* obj-c++.dg/gnu-api-2-class.mm: Same change.
From-SVN: r168230
In libobjc/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/runtime.h (sel_getType): Renamed to sel_getTypeEncoding to
be consistent with method_getTypeEncoding and
ivar_getTypeEncoding.
(sel_copyTypedSelectorList, sel_getTypedSelector): New.
* selector.c (sel_getType): Renamed to sel_getTypeEncoding.
(sel_copyTypedSelectorList, sel_getTypedSelector): New.
(sel_get_type): Updated call to sel_getType.
In gcc/testsuite/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-sel.m: Updated for renaming of sel_getType to
sel_getTypeEncoding. Test that sel_getTypeEncoding returns NULL
when called with a NULL argument. Added test for
sel_copyTypedSelectorList and sel_getTypedSelector.
* obj-c++.dg/gnu-api-2-sel.mm: Same changes.
From-SVN: r168229
In libobjc/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/runtime.h (class_conformsToProtocol,
class_copyProtocolList): Updated documentation.
In gcc/testsuite/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* obj-c.dg/gnu-api-2-class.m: Test that class_conformsToProtocol()
does not check the superclasses.
* obj-c++.dg/gnu-api-2-class.mm: Same change.
From-SVN: r168226
In gcc/testsuite/:
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-objc.m: Fixed test to test objc_lookUpClass,
not objc_lookupClass.
* obj-c++.dg/gnu-api-2-objc.mm: Same change.
In libobjc/:
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
* class.c (objc_lookupClass): Renamed to objc_lookUpClass.
* protocols.c: Updated all calls to objc_lookupClass to call
objc_lookUpClass instead.
* sendmsg.c (objc_lookupClass): Do not declare.
(get_imp): Update call to objc_lookupClass to call
objc_lookUpClass instead.
* objc/runtime.h (objc_lookupClass): Renamed to objc_lookUpClass.
From-SVN: r168059
In libobjc/:
2010-12-15 Nicola Pero <nicola.pero@meta-innovation.com>
* ivars.c (class_addIvar): Use the 'size' argument instead of
trying to calculate it using objc_sizeof_type().
* objc/runtime.h (class_addIvar): Updated comments.
From-SVN: r167837
In gcc/:
2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
* doc/objc.texi (GNU Objective-C runtime API): New section.
(Modern GNU Objective-C runtime API): New section.
(Traditional GNU Objective-C runtime API): New section.
(Executing code before main): Mention that this section is
specific to the GNU Objective-C runtime.
(Garbage Collection): Same.
In gcc/testsuite/:
2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
* obj-c++.dg/gnu-api-2-class.mm: New.
* obj-c++.dg/gnu-api-2-ivar.mm: New.
* obj-c++.dg/gnu-api-2-method.mm: New.
* obj-c++.dg/gnu-api-2-objc.mm: New.
* obj-c++.dg/gnu-api-2-object.mm: New.
* obj-c++.dg/gnu-api-2-property.mm: New.
* obj-c++.dg/gnu-api-2-protocol.mm: New.
* obj-c++.dg/gnu-api-2-sel.mm: New.
In libobjc/:
2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/message.h: Moved initial includes outside of extern "C".
* objc/runtime.h: Add extern "C" for Objective-C++.
From-SVN: r165595
In libobjc/:
2010-10-16 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/runtime.h: Updated comments.
(class_addMethod): New.
(class_addIvar): New.
(class_replaceMethod): New.
(objc_allocateClassPair): New.
(objc_registerClassPair): New.
(objc_disposeClassPair): New.
* class.c (objc_allocateClassPair): New.
(objc_registerClassPair): New.
(objc_disposeClassPair): New.
(class_getSuperclass): Return Nil if a class is in construction.
* init.c (__objc_exec_class): Call __objc_init_class.
(__objc_init_class): New.
* ivars.c (class_copyIvarList): Return NULL if class is in
construction. Do not lock the runtime mutex.
(class_getInstanceVariable): Return NULL if class is in
construction. Do not lock the runtime mutex.
(class_addIvar): New.
* sendmsg.c (class_addMethod): New.
(class_replaceMethod): New.
* objc-private/module-abi-8.h (__CLS_SETNOTINFO): New.
(_CLS_IN_CONSTRUCTION): New.
(CLS_IS_IN_CONSTRUCTION): New.
(CLS_SET_IN_CONSTRUCTION): New.
(CLS_SET_NOT_IN_CONSTRUCTION): New.
* objc-private/runtime.h (__objc_init_class): New.
From-SVN: r165563
In libobjc/:
2010-10-14 Nicola Pero <nicola.pero@meta-innovation.com>
* init.c (__objc_init_protocol): New function which fixes up a
protocol's class pointer, registers it with the runtime, register
all protocol selectors and registers associated protocols too.
(objc_init_statics): Detect if we are initializing protocols, and
if so, use __objc_init_protocol instead of only fixing up the
class pointer.
(__objc_init_protocls): Use __objc_init_protocol.
* objc-private/module-abi-8.h: Updated comments.
* objc-private/runtime.h
(__objc_register_selectors_from_description_list): New.
* selector.c (__objc_register_selectors_from_description_list):
New. (struct objc_method_description_list): Declare.
* Protocol.m ([-descriptionForInstanceMethod:]): Use sel_get_name
when accessing the name of a method, which is now correctly a SEL.
([-descriptionForClassMethod:]): Same change.
* protocols.c (protocol_getMethodDescription): Same change.
* objc/runtime.h: Updated comments.
(sel_registerTypedName): Fixed typo in function name.
From-SVN: r165499
2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
* archive.c: Do not include objc/objc.h.
* class.c: Do not include objc/objc.h.
* encoding.c: Include objc/runtime.h, ctype.h and
objc-private/module-abi-8.h instead of objc/objc-api.h and
objc/encoding.h.
* error.c: Do not include objc/objc.h.
* gc.c: Include tconfig.h and objc/encoding.h only if
OBJC_WITH_GC.
* hash.c: Include objc/runtime.h and objc/thr.h instead of
objc/objc-api.h. Do not include objc/objc.h.
* init.c: Do not include objc/objc.h.
* ivars.c: Include objc/runtime.h, objc-private/module-abi-8.h and
objc/thr.h instead of objc/objc-api.h. Do not include
objc/objc.h.
* linking.m: Tidied comment.
* memory.c: Include objc/runtime.h instead of objc/objc-api.h.
Do not include objc/objc.h.
* objects.c: Do not include objc/objc.h.
* objc-sync.c: Include objc/runtime.h instead of objc/objc-api.h.
* protocols.c: Do not include objc/objc.h.
* sarray.c: Include objc/runtime.h instead of objc/objc-api.h. Do
not include objc/objc.h.
* selector.c: Do not include objc/objc.h.
* sendmsg.c: Do not include objc/objc.h.
* thr.c: Include objc/runtime.h instead of objc/objc-api.h.
Do not include objc/objc.h.
* objc/objc-decls.h: Reindented code.
* objc/runtime.h Include objc-decls.h. Updated comments.
(objc_malloc): New.
(objc_atomic_malloc): New.
(objc_calloc): New.
(objc_realloc): New.
(objc_free): New.
* objc-private/runtime.h: Updated comments.
From-SVN: r165386
2010-10-11 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/objc.h: Updated comments.
* objc/objc-api.h: (object_copy): Added one argument; use a
#define to maintain backwards-compatibility. Moved
_objc_object_alloc, _objc_object_copy, _objc_object_dispose and
objc_get_uninstalled_dtable into
objc/deprecated/objc_get_uninstalled_dtable.h and
objc/deprecated/objc_object_alloc.h. Include these files.
* objc/deprecated/objc_get_uninstalled_dtable.h: New.
* objc/deprecated/objc_object_alloc.h: New.
* objc/runtime.h (set_getName): New.
(sel_getType): New.
(sel_getUid): New.
(sel_registerName): New.
(sel_registerTypedName): New.
(sel_isEqual): New.
(class_createInstance): New.
(object_copy): New.
(object_dispose): New.
* objects.c: Do not include tconfig.h. Include gc_typed.h if
building the garbage collection version.
(__objc_object_alloc): Removed.
(__objc_object_copy): Removed.
(__objc_object_dispose): Removed.
(class_createInstance): New from code in class_create_instance.
Cast second argument of GC_malloc_explicitly_typed. Use
objc_calloc. Do not call _objc_object_alloc.
(class_create_instance): Call class_createInstance.
(object_copy): Added extraBytes argument. Do not call
_objc_object_copy.
(object_dispose): Do not call _objc_object_dispose.
* memory.c (objc_free): When using garbage collection, mark the
argument as unused.
* selector.c (sel_getName): New.
(sel_get_name): Call sel_getName.
(sel_getType): New.
(sel_get_type): Call sel_getType.
(sel_registerName): New.
(sel_register_name): Call sel_registerName.
(sel_registerTypedName): New.
(sel_register_typed_name): Call sel_registerTypedName.
(sel_getUid): New.
(sel_get_uid): Call sel_getUid.
From-SVN: r165264
In libobjc/:
2010-10-10 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/objc-api.h: Define Method, Method_t, Category and
Category_t. Prevent including this file at the same time as
objc/runtime.h. Updated comments.
* objc/deprecated/struct_objc_method.h: Do not define Method,
Method_t.
* objc/deprecated/struct_objc_category.h: Do not define Category,
Category_t.
* objc-private/module-abi-8.h: New file containing a copy of all
the structure definitions. Not used yet.
* objc/encoding.h (objc_aligned_size): Removed duplicate
declaration. Updated comments.
* objc/runtime.h: Added Ivar, objc_property_t, Property, Method,
Category, struct objc_method_description, _C_ID and similar,
_C_CONST and similar and _F_CONST and similar. Added
objc_sizeof_type, objc_alignof_type, objc_aligned_size,
objc_promoted_size, objc_skip_type_qualifier, objc_skip_typespec,
objc_skip_offset, objc_skip_argspec, objc_get_type_qualifiers,
struct objc_struct_layout, objc_layout_structure,
objc_layout_structure_next_member, objc_layout_finish_structure,
objc_layout_structure_get_info. Prevent including this file at
the same time as objc/objc-api.h.
From-SVN: r165256
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
* 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
2005-06-08 David Ayers <d.ayers@inode.at>
* objc/NXConstStr.h, objc/Object.h, objc/Protocol.h,
objc/encoding.h, objc/hash.h, objc/objc-api.h,
objc/runtime.h, objc/sarray.h, objc/thr.h,
objc/typedstream.h: Do not include Objective-C headers as
system headers.
From-SVN: r100760
2004-05-25 Andrew Pinski <pinskia@physics.uc.edu>
Merge from the libobjc-branch
2004-02-09 Andrew Pinski <pinskia@physics.uc.edu>
* Makefile.in (OBJC_H): Change objc-deps.h to objc-decls.h.
2004-02-03 Andrew Pinski <pinskia@physics.uc.edu>
* Makefile.in (OBJC_H): Add objc-deps.h.
2004-01-27 Nicola Pero <n.pero@mi.flashnet.it>
* Protocol.m ([-conformsTo:]): If the argument is nil, return NO.
([-hash], [-isEqual:]): New methods.
2004-01-27 Richard Frith-Macdonald <rfm@gnu.org>
* sarray.c (sarray_free): Add a better comment.
2004-01-27 Adam Fedor <fedor@gnu.org>
* hash.c (hash_add): Cast cachep to int.
* selector.c (__sel_register_typed_name): Cast
soffset_decode to int.
2004-01-27 Alexander Malmberg <alexander@malmberg.org>
* selector.c: Rename register_selectors_from_list to
__objc_register_selectors_from_list. Update caller.
(__objc_register_selectors_from_list): Lock __objc_runtime_mutex
while registering selectors. Use __sel_register_typed_name instead
of sel_register_typed_name. Check for NULL method_name:s.
(pool_alloc_selector): New function.
(__sel_register_typed_name): Use pool_alloc_selector to allocate
selector structures.
* sendmsg.c (class_add_method_list): Use
__objc_register_selectors_from_list.
* objc/runtime.h: Add __objc_register_selectors_from_list.
2004-01-25 Adam Fedor <fedor@gnu.org>
Nicola Pero <n.pero@mi.flashnet.it>
Andrew Pinski <pinskia@physics.uc.edu>
* objc/objc-decls.h: New file.
* objc/objc-api.h (_objc_lookup_class): Mark as export.
(_objc_load_callback): Likewise.
(_objc_object_alloc): Likewise.
(_objc_object_copy): Likewise.
(_objc_object_dispose): Likewise.
2004-01-25 Andrew Pinski <pinskia@physics.uc.edu>
* archive.c: s/__inline__/inline
* sendmsg.c: Likewise.
* encoding.c: Remove FIXME about the warning
about unused variable.
* sendmsg.c: Add a FIXME comment saying that
this should be using libffi.
* Makefile.in (LIBTOOL): Use @LIBTOOL@ now as it works.
From-SVN: r82253