Commit Graph

18 Commits

Author SHA1 Message Date
Jonas Maebe
40a9762ac6 * objcprotocol symbols have to be weak in the non-fragile abi to prevent
conflicts in case a protocol is adopted by classes in multiple object
    files part of the same binary (mantis #20875)

git-svn-id: trunk@19865 -
2011-12-17 12:43:42 +00:00
paul
4cf5e36ce7 compiler:
- add TTagHashSet class descendant of THashSet with an ability to has also a LongWord value together with key
  - change TAsmData.ConstPools[] to be an indexed property to properly initialize ConstPool class, remove pool initialization from all other units
  - add ansistring constants to pool together with their encoding to distinct the same text constants with different codepage
  + test

git-svn-id: trunk@19261 -
2011-09-28 01:18:43 +00:00
Jonas Maebe
bcc836f1b0 * put the RTTI for optional protocol methods in the correct section for
fragile ABI platforms

git-svn-id: trunk@15465 -
2010-06-21 15:07:29 +00:00
Jonas Maebe
835899524b + support for Objective-Pascal for-in loops ("fast enumerations")
+ {$modeswitch objectivec2}, which is required before you can use
    Objective-C 2.0 features (such as the above). It automatically
    also implies {$modeswitch objectivec1}
  + genloadfield() helper to load a field of a node representing
    a record/object/class

git-svn-id: trunk@15460 -
2010-06-20 12:38:45 +00:00
Jonas Maebe
caca6cea37 * allow any kind of fields in Object Pascal classes that are passed to
Objective-C methods or which are fields of Objective-C classes (since they
    are basically opaque to the Objective-C runtime) + fixed tobjc11 so it
    expects classes to be encoded as opaque types
  * give a proper error message when using illegal field/parameter types in
    Objective-C classes/methods instead of an internal error (only checked
    during rtti generation rather than during parsing, because during parsing
    some types may still be forwarddefs)
  * split objcutil in objcdef and objcutil, with objcdef depending only on
    the symtable so it can be used in symdef

git-svn-id: trunk@14838 -
2010-01-31 21:13:41 +00:00
florian
c1f3d8dcaa * unified names of system_*/systems_* sets
git-svn-id: trunk@14566 -
2010-01-07 18:16:20 +00:00
Jonas Maebe
80499a1732 * don't align entries in string sections, gcc doesn't either
git-svn-id: trunk@14246 -
2009-11-21 21:24:27 +00:00
Jonas Maebe
f8754d8fab + Objective-C category support (old and new ABI, both external and
implemented in Pascal). See
    http://wiki.freepascal.org/FPC_PasCocoa#Category_declaration for syntax
    details

git-svn-id: trunk@14196 -
2009-11-16 00:12:08 +00:00
Jonas Maebe
102a2a4796 * changed "optional" field (which denotes whether an objc protocol method is
required or optional) into a procoption flag
  * reordered some procdef fields to have less wasted space due to alignment

git-svn-id: branches/objc@14049 -
2009-11-04 16:29:39 +00:00
Jonas Maebe
0c675a4039 * the objc1 unit has been renamed to objc
* the objc unit links against the Foundation instead of against the Cocoa
    framework, and inludes an interface to either the fragile or non-fragile
    obj-c run time depending on the target platform
  + support for the non-fragile Objective-C runtime/ABI, as used on Mac OS X
    for ARM (iPhone) 64 bit (PowerPC/64, x86_64) -- all these targets now
    are now also supported for the objectivec1 modeswitch
  + support for private_extern symbol bindings, required for the above
  * mark objcclasses that are declared in the implementation section of a
    unit as "hidden" (not sure what the effect is, since the Objective-C
    runtime does not seem to do anything with this flag)
  * enabled all obj-c tests for the newly supported platforms

git-svn-id: branches/objc@13763 -
2009-09-27 15:24:50 +00:00
Jonas Maebe
d942c99921 + support for obj-c protocols implemented in Pascal (based on patch by
Dmitry Boyarintsev, mantis #14609)

git-svn-id: branches/objc@13731 -
2009-09-17 14:24:01 +00:00
Jonas Maebe
ef2fbe7ed6 * use precalculated mangled name when writing classdef instead of
calculating it again (+ sanity check that it is really defined)

git-svn-id: branches/objc@13721 -
2009-09-16 16:44:26 +00:00
Jonas Maebe
356ad9893a * define rtti mangled names for obj-c classes and metaclasses
(mainly for use in the future to optimize inherited calls)

git-svn-id: branches/objc@13684 -
2009-09-09 22:22:26 +00:00
Jonas Maebe
e393446769 * fixed several omissions that could cause the dynamic linker not to
register required classes:
    + add lazy references to classes referred to in the current unit
    + define reference symbols for classes defined in the current unit
    + add lazy references to parent classes of classes defined in the current
      unit

git-svn-id: branches/objc@13679 -
2009-09-08 16:05:41 +00:00
Jonas Maebe
1705a1e5b8 * fixed memory leak after previous change
git-svn-id: branches/objc@13671 -
2009-09-07 19:05:48 +00:00
Jonas Maebe
ab8e119c3e * use separate pools for obj-c strings and string references
git-svn-id: branches/objc@13670 -
2009-09-07 19:01:50 +00:00
Jonas Maebe
fc40e1fe5b + support for implementing Objective-C classes in Pascal,
based on patch by Dmitry Boyarintsev (mantis #14508)
   o Todo: while parsing the class declaration, check whether the
       field types are valid for use in an obj-c class
  * use a common pool for selector names generated by objcselector()
    and by the rtti info for implemented classes

git-svn-id: branches/objc@13663 -
2009-09-06 18:35:48 +00:00
Jonas Maebe
b1b9894ae3 * initial Objective-C 1.0 support:
o support for declaring external Objective-C classes (see
      rtl/inc/objcbase.pas), including derived classes
    o support for converting methods of objcclasses into selectors
      (see tests/test/tobjc1.pp)
    o support for loading from/storing to fields of objcclasses
    o support for calling Objective-C methods using regular
      Object Pascal syntax (see tests/test/tobjc1.pp)
    o some things that are known to be not yet working:
      o automatic conversion from ID to objcclasses and back
      o declaring and implementing new objcclasses/methods in Pascal code
      o debug information (objcclasses are currently plain pointers
        as far as the debugger knows)

git-svn-id: branches/objc@13162 -
2009-05-17 13:42:50 +00:00