177b48f930
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 |
||
---|---|---|
.. | ||
objc | ||
objc-private | ||
acinclude.m4 | ||
aclocal.m4 | ||
archive.c | ||
ChangeLog | ||
class.c | ||
config.h.in | ||
configure | ||
configure.ac | ||
encoding.c | ||
error.c | ||
exception.c | ||
gc.c | ||
hash.c | ||
init.c | ||
libobjc.def | ||
linking.m | ||
Makefile.in | ||
memory.c | ||
nil_method.c | ||
NXConstStr.m | ||
objc-sync.c | ||
Object.m | ||
objects.c | ||
Protocol.m | ||
README | ||
sarray.c | ||
selector.c | ||
sendmsg.c | ||
thr.c | ||
THREADS |
GNU Objective C notes ********************* This document is to explain what has been done, and a little about how specific features differ from other implementations. The runtime has been completely rewritten in gcc 2.4. The earlier runtime had several severe bugs and was rather incomplete. The compiler has had several new features added as well. This is not documentation for Objective C, it is usable to someone who knows Objective C from somewhere else. Runtime API functions ===================== The runtime is modeled after the NeXT Objective C runtime. That is, most functions have semantics as it is known from the NeXT. The names, however, have changed. All runtime API functions have names of lowercase letters and underscores as opposed to the `traditional' mixed case names. The runtime api functions are not documented as of now. Someone offered to write it, and did it, but we were not allowed to use it by his university (Very sad story). We have started writing the documentation over again. This will be announced in appropriate places when it becomes available. Protocols ========= Protocols are now fully supported. The semantics is exactly as on the NeXT. There is a flag to specify how protocols should be typechecked when adopted to classes. The normal typechecker requires that all methods in a given protocol must be implemented in the class that adopts it -- it is not enough to inherit them. The flag `-Wno-protocol' causes it to allow inherited methods, while `-Wprotocols' is the default which requires them defined. +load =========== This method, if defined, is called for each class and category implementation when the class is loaded into the runtime. This method is not inherited, and is thus not called for a subclass that doesn't define it itself. Thus, each +load method is called exactly once by the runtime. The runtime invocation of this method is thread safe. +initialize =========== This method, if defined, is called before any other instance or class methods of that particular class. For the GNU runtime, this method is not inherited, and is thus not called as initializer for a subclass that doesn't define it itself. Thus, each +initialize method is called exactly once by the runtime (or never if no methods of that particular class is never called). It is wise to guard against multiple invocations anyway to remain portable with the NeXT runtime. The runtime invocation of this method is thread safe. Passivation/Activation/Typedstreams =================================== This is supported in the style of NeXT TypedStream's. Consult the headerfile Typedstreams.h for api functions. I (Kresten) have rewritten it in Objective C, but this implementation is not part of 2.4, it is available from the GNU Objective C prerelease archive. There is one difference worth noting concerning objects stored with objc_write_object_reference (aka NXWriteObjectReference). When these are read back in, their object is not guaranteed to be available until the `-awake' method is called in the object that requests that object. To objc_read_object you must pass a pointer to an id, which is valid after exit from the function calling it (like e.g. an instance variable). In general, you should not use objects read in until the -awake method is called. Acknowledgements ================ The GNU Objective C team: Geoffrey Knauth <gsk@marble.com> (manager), Tom Wood <wood@next.com> (compiler) and Kresten Krab Thorup <krab@iesd.auc.dk> (runtime) would like to thank a some people for participating in the development of the present GNU Objective C. Paul Burchard <burchard@geom.umn.edu> and Andrew McCallum <mccallum@cs.rochester.edu> has been very helpful debugging the runtime. Eric Herring <herring@iesd.auc.dk> has been very helpful cleaning up after the documentation-copyright disaster and is now helping with the new documentation. Steve Naroff <snaroff@next.com> and Richard Stallman <rms@gnu.ai.mit.edu> has been very helpful with implementation details in the compiler. Bug Reports =========== Please read the section `Submitting Bugreports' of the gcc manual before you submit any bugs.