Commit Graph

22 Commits

Author SHA1 Message Date
Jonas Maebe
cec5843f95 * renamed objcdef.addencodedtype to objcaddencodedtype for consistency
reasons, and to prevent name clashes

git-svn-id: trunk@16598 -
2010-12-19 19:37:47 +00:00
joost
07bf44517c * Merged XPCom branch into trunk, added support for constref and changed
the IInterface implementation to be XPCom-compatible
--- Merging r15997 through r16179 into '.':
U    rtl/inc/variants.pp
U    rtl/inc/objpash.inc
U    rtl/inc/objpas.inc
U    rtl/objpas/classes/persist.inc
U    rtl/objpas/classes/compon.inc
U    rtl/objpas/classes/classesh.inc
A    tests/test/tconstref1.pp
A    tests/test/tconstref2.pp
A    tests/test/tconstref3.pp
U    tests/test/tinterface4.pp
A    tests/test/tconstref4.pp
U    tests/webtbs/tw10897.pp
U    tests/webtbs/tw4086.pp
U    tests/webtbs/tw15363.pp
U    tests/webtbs/tw2177.pp
U    tests/webtbs/tw16592.pp
U    tests/tbs/tb0546.pp
U    compiler/sparc/cpupara.pas
U    compiler/i386/cpupara.pas
U    compiler/pdecsub.pas
U    compiler/symdef.pas
U    compiler/powerpc/cpupara.pas
U    compiler/avr/cpupara.pas
U    compiler/browcol.pas
U    compiler/defcmp.pas
U    compiler/powerpc64/cpupara.pas
U    compiler/ncgrtti.pas
U    compiler/x86_64/cpupara.pas
U    compiler/opttail.pas
U    compiler/htypechk.pas
U    compiler/tokens.pas
U    compiler/objcutil.pas
U    compiler/ncal.pas
U    compiler/symtable.pas
U    compiler/symsym.pas
U    compiler/m68k/cpupara.pas
U    compiler/regvars.pas
U    compiler/arm/cpupara.pas
U    compiler/symconst.pas
U    compiler/mips/cpupara.pas
U    compiler/paramgr.pas
U    compiler/psub.pas
U    compiler/pdecvar.pas
U    compiler/dbgstabs.pas
U    compiler/options.pas
U    packages/fcl-fpcunit/src/testutils.pp

git-svn-id: trunk@16180 -
2010-10-17 20:58:22 +00:00
Jonas Maebe
f13f6627c4 * moved use_fixed_stack from cgutils to a method in paramgr so it can
be used outside the code generator
  * renamed tabstractprocdef.requiredargarea into callerargareasize,
    and also added calleeargareasize field; added init_paraloc_info(side)
    method to init the parameter locations and init those size fields and
    replaced all "if not procdef.has_paraloc_info then ..." blocks with
    procdef.init_paraloc_info(callersize)"
  * moved detection of stack tainting parameters from psub to
    symdef/tabstractprocdef
  + added tcallparanode.contains_stack_tainting_call(), which detects
    whether a parameter contains a call that makes use of stack paramters
  * record for each parameter whether or not any following parameter
    contains a call with stack parameters; if not, in case the current
    parameter itself is a stack parameter immediately place it in its
    final location also for use_fixed_stack platforms rather than
    first putting it in a temporary location (part of mantis #17442)
  * on use_fixed_stack platforms, always first evaluate parameters
    containing a stack tainting call, since those force any preceding
    stack parameters of the current call to be stored in a temp location
    and copied to the final location afterwards

git-svn-id: trunk@16050 -
2010-09-26 21:24:14 +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
f191ab39cd * don't use a voidpointer typecast to access hardcoded objc fields, because
that sets the alignment to 1 and hence causes unnecessary unaligned
    loads/stores on ARM

git-svn-id: trunk@14291 -
2009-11-30 20:43:48 +00:00
Jonas Maebe
a6716fd2a2 * fixed calling inherited class methods from category methods when using
the iPhoneOS/Mac OS X 10.6 objc runtime interface (tests/test/tobjc25.pp)

git-svn-id: trunk@14289 -
2009-11-29 21:41:47 +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
8700874a96 * don't call class_getSuperClass() anymore to obtain the superclass, but
load it inline. This should be safe even on the non-fragile ABI, because
    the isa and superclass fields are expected at fixed offsets by the runtime
    (and gcc and clang also use direct memory accesses in this case)

git-svn-id: branches/objc@13784 -
2009-10-01 12:07:22 +00:00
Jonas Maebe
97ba8de56c * don't export the symbols for "strict private" fields (it was only not
done for regular private fields)

git-svn-id: branches/objc@13782 -
2009-10-01 11:55:23 +00:00
Jonas Maebe
3f0eee741a * fixed checking whether first character of a selector is valid (patch by
Dmitry Boyarintsev, mantis #14680)

git-svn-id: branches/objc@13768 -
2009-09-28 08:40:27 +00:00
Jonas Maebe
6f3bace0f3 + support for exporting Objective-C classes from dynamic libraries. It works
the same as for exporting functions/procedures and variables: add the name
    of the class to the "exports" section of the library. By default, classes
    are only visible inside a shared library.

git-svn-id: branches/objc@13765 -
2009-09-27 15:40:52 +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
b76def10b2 + check whether selector names are valid when they are specified in a class
delcaration (instead of only for objcselector() nodes)
  * also print the wrong selector itself when it's wrong

git-svn-id: branches/objc@13689 -
2009-09-11 16:12:27 +00:00
Jonas Maebe
3c9e1742dd * fixed calling inherited methods in Objective-C + test
git-svn-id: branches/objc@13686 -
2009-09-09 22:27:39 +00:00
Jonas Maebe
e0b7e8aa55 * made internalerror unique
git-svn-id: branches/objc@13683 -
2009-09-09 09:30:52 +00:00
Jonas Maebe
1048ac96d5 * skip hidden function result parameters when generating message signatures
git-svn-id: branches/objc@13662 -
2009-09-06 17:18:49 +00:00
Jonas Maebe
27385550f8 * use the (sorted) paras rather than the (unsorted) parasymtable when
generating method signatures

git-svn-id: branches/objc@13661 -
2009-09-06 17:15:00 +00:00
Jonas Maebe
b3737214b0 * use paraloc info to obtain parameter size (instead of (re)calulcating it
from the def)
  + added (disabled) code to correctly calculate the parameter offsets for
    ppc, see comments why it's not activated

git-svn-id: branches/objc@13619 -
2009-08-30 09:30:59 +00:00
Jonas Maebe
8def2c2ac3 * fixed compilation after introduction of strict class type checking
for var/out parameters

git-svn-id: branches/objc@13597 -
2009-08-25 19:43:45 +00:00
Jonas Maebe
5885866990 + support for objcencode() (equivalent of Objective-C's @encode()) + test
+ functionality to encode Objective-C function signatures (untested)

git-svn-id: branches/objc@13557 -
2009-08-18 19:54:02 +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