Commit Graph

40 Commits

Author SHA1 Message Date
J. Gareth "Curious Kit" Moreton
f6c741ee73 * Corrected label reference counts caused by TAsmLabel.GetName incrementing refs 2022-05-14 18:57:05 +00:00
Jonas Maebe
229eb93e72 tnodeuitls: merge GenerateObjCImageInfo into InsertObjectInfo
LLVM needs to insert the Objective-C image info into the general object info
metadata. This way we don't need to store a reference to that metadata so
as to add extra data to it later (tnodeutils is never instantiated, it only
contains class methods)
2022-05-13 22:49:02 +02:00
Jonas Maebe
e7d1a77f9a * rename the ARM/AArch64-Darwin targets to ARM/AArch64-iOS
* rename the m68k/PowerPC-MacOS targets to m68k/PowerPC-MacOSClassic
  * repurpose the AArch64/Darwin target for AArch64/macOS
   o make AArch64-Darwin default target for a hosted AArch64-Darwin compiler

git-svn-id: trunk@45758 -
2020-07-10 21:52:24 +00:00
florian
84a1f614d9 * fix several double ;
git-svn-id: trunk@45488 -
2020-05-24 17:52:09 +00:00
Jonas Maebe
d8903ce6b3 - removed maxcrecordalign parameter/field from recordsymtables, as this value
cannot be modified in the settings (so we can directly use the one from
    current_settings)

git-svn-id: trunk@42447 -
2019-07-14 19:24:32 +00:00
Jonas Maebe
7dbbce157f * fixed Objective-C metadata generation for LLVM
git-svn-id: branches/debug_eh@41980 -
2019-05-02 19:45:34 +00:00
florian
68eb921d46 * broken compilation after r39347 fixed
git-svn-id: trunk@39349 -
2018-06-30 12:30:25 +00:00
nickysn
88ba9269ca * use .create_int_dataptr instead of .create_pint in the remaining two places where .create_pint is used
git-svn-id: trunk@34835 -
2016-11-07 15:09:07 +00:00
nickysn
501b9481c5 * use .create_nil_codeptr instead of .create_pint(0) for writing the placeholder
address of implementation field in tobjcrttiwriter.gen_objc_cat_methods

git-svn-id: trunk@34705 -
2016-10-10 15:40:10 +00:00
nickysn
9669e5aa00 * use .create_nil_dataptr instead of .create_pint(0) for writing the 'next'
field in tobjcrttiwriter.gen_objc_protocol_list

git-svn-id: trunk@34704 -
2016-10-10 14:03:52 +00:00
Jonas Maebe
94eb087aa2 * fixed typo (obcj -> objc)
git-svn-id: trunk@34452 -
2016-09-08 14:18:56 +00:00
Jonas Maebe
10fb90b415 * mark symbols in "no_dead_strip" Objective-C sections also as no_dead_strip
at the symbol level (needed for LLVM)

git-svn-id: trunk@34388 -
2016-08-28 22:07:52 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
d1b9e8ca54 - removed stray statement that should have been removed as part of r34158
git-svn-id: trunk@34247 -
2016-08-03 14:35:35 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
Jonas Maebe
84129857c2 * converted tobjcrttiwriter_fragile.gen_objc_info_sections to the high level
typed constant builder

git-svn-id: trunk@34158 -
2016-07-19 14:30:51 +00:00
Jonas Maebe
8fea7344c9 * added an extra parameter to ttai_typedconstbuilder.emit_pchar_const() to
indicate whether it should create a copy of the pchar or not

git-svn-id: trunk@34153 -
2016-07-19 14:30:36 +00:00
Jonas Maebe
b9231aa6f1 * converted objcgutl (Objective-C metadata generation) to the high level
typed const builder

git-svn-id: trunk@32917 -
2016-01-10 17:22:20 +00:00
Jonas Maebe
9ffadf2941 * write nil instead of a reference to _objc_empty_vtable for iOS and the
iOS simulator (based on clang source)

git-svn-id: trunk@32182 -
2015-10-28 21:00:57 +00:00
Jonas Maebe
8c89f7ee8f * AArch64 also uses the non-fragile Objective-C ABI
git-svn-id: trunk@29893 -
2015-02-23 22:51:31 +00:00
Jonas Maebe
a4c938c042 * changed some random data label names to match the label names outputted by
current clang versions, works around some bugs (or at least backward
    incompatibilities) in the Xcode 5 linker when targeting ARM

git-svn-id: trunk@26334 -
2013-12-31 00:28:46 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
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