Commit Graph

120 Commits

Author SHA1 Message Date
ondrej
9a9cd15ec4 TInterfacedObject.Destroy: fix case for correct auto-completion
git-svn-id: trunk@43418 -
2019-11-08 21:29:26 +00:00
svenbarth
e97a2cb03e * tests with Delphi showed that an attribute class must explicitely declare a parameterless constructor if it should be used, cause TCustomAttribute.Create is private
Note: this also means that TCustomAttribute itself can not be used as an attribute
* adjusted existing tests
+ added test

git-svn-id: trunk@42471 -
2019-07-20 20:03:38 +00:00
svenbarth
b2932393df Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 1/3]
Implemented attributes for class types and properties (based on work by Joost van der Sluis). Added TCustomAttribute - a base class for attributes. Added TUnitInfo record to RTTI. It contains the unit name and unit options (for now only a flag which specifies if the unit contains attributes). Added several tests for attributes.

git-svn-id: trunk@42356 -
2019-07-12 22:04:48 +00:00
florian
3b77146e1c * adapt FPC_Unwind_Exception for native eh_frame support
git-svn-id: branches/debug_eh@41307 -
2019-02-11 20:30:21 +00:00
Jonas Maebe
ef1757a5a7 + ARM EABI exception handling support for PSABIEH
git-svn-id: branches/debug_eh@41213 -
2019-02-03 21:10:04 +00:00
Jonas Maebe
3cfad8fba8 * renamed FPC_USE_PSEABIEH to FPC_USE_PSABIEH
git-svn-id: branches/debug_eh@40400 -
2018-11-29 21:30:42 +00:00
Jonas Maebe
b2d1ab7f05 * basic helpers for DWARF/PSABI EH-based exception handling (based on
GCC 4.2.1's libstdc++/libsupc++)
   - compile RTL with -dFPC_USE_PSEABIEH to include
   - the x86-64 compiler currently crashes if it has been compiled with
     optimizations (the eh_return_data_regno function from cpubase
     probably triggers mantis #34385)

git-svn-id: branches/debug_eh@40071 -
2018-10-28 18:16:42 +00:00
florian
0725bfcdf0 * do not generate references to the variant type, if the variants feature is not available
git-svn-id: trunk@37660 -
2017-12-02 17:16:32 +00:00
michael
3787d52dee * Fix bug ID #32353, reset ref count fields in destructor
git-svn-id: trunk@37112 -
2017-09-02 15:07:23 +00:00
michael
9878dc280b * Fix bug ID #32168
git-svn-id: trunk@36757 -
2017-07-21 16:08:01 +00:00
marco
a2d397c064 * pmethod declaration, patch from mantis #31576 by Silvio
git-svn-id: trunk@35632 -
2017-03-20 21:19:20 +00:00
florian
091b31fc76 * fix avr compilation after r34975 by more tests against feature defines, resolves #31036
git-svn-id: trunk@35015 -
2016-11-29 20:37:58 +00:00
florian
bcb7061314 * made TObject usable, even if no ansistring support is available
git-svn-id: trunk@34974 -
2016-11-26 19:33:31 +00:00
michael
784da563ef * Patch from Silvio Clecio to implement QualifiedClassName (bug ID 30985)
git-svn-id: trunk@34966 -
2016-11-26 13:53:27 +00:00
nickysn
7d15b688e8 * TInterfaceEntry changed to a variant record, that overlays a CodePointer on
top of the IOffset: SizeUInt field, because it is sometimes used as a
  CodePointer (for etStaticMethodResult and etStaticMethodClass) and sometimes
  as a SizeInt and these two types can be of different size in certain i8086
  memory models

git-svn-id: trunk@34645 -
2016-10-07 20:18:02 +00:00
nickysn
019f904be8 - removed the FPC 2.6.x compatibility ifdefs from tinterfaceentry
git-svn-id: trunk@34637 -
2016-10-06 21:10:40 +00:00
svenbarth
fb6546972b * IID and IIDStr references of the VMT's interface table need to be indirect
git-svn-id: trunk@34338 -
2016-08-19 13:06:26 +00:00
svenbarth
61551cbb0f * move properties and functions of TVMT to the end of the record, so that one only needs to adjust the total entry count TVMTBuilder.generate_vmt_def()
git-svn-id: trunk@34223 -
2016-07-29 13:54:36 +00:00
svenbarth
685f820622 * switch class'/object's parent reference in the VMT to an indirect reference
(this also requires the adjustment of a test)

git-svn-id: trunk@34172 -
2016-07-22 12:53:51 +00:00
Jonas Maebe
f22c7cc3fc - removed "packed" and dummy field (that was required because of
the "packed" keyword) from the TResourceStringRecord record

git-svn-id: trunk@32393 -
2015-11-21 12:36:03 +00:00
Jonas Maebe
0c904e92ff * moved TResourceStringRecord from the objpas to the system unit so it can be
used in the compiler when emitting resourcestrings

git-svn-id: trunk@32208 -
2015-10-30 20:45:19 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
87e55caabc * declare tvarrec.vpchar explicitly as pansichar for documentation purposes
(mantis #26842)

git-svn-id: trunk@28823 -
2014-10-15 15:37:23 +00:00
Jonas Maebe
427b05e97c * converted TVMTWriter.intf_write_table() to the high level typed constant
builder
   o removed variant record part in the RTL to force a specific size/alignment,
     since we now import the record into the compiler and hence it will always
     be handled correctly

git-svn-id: branches/hlcgllvm@28777 -
2014-10-06 20:54:23 +00:00
florian
03c553606e - unneeded spaces removed
git-svn-id: trunk@28740 -
2014-10-04 13:45:17 +00:00
nickysn
4f4e00e758 + i8086 far data memory model fixes in tinterfaceentry and tinterfacetable
git-svn-id: trunk@27724 -
2014-05-03 14:38:00 +00:00
nickysn
e1716c097d * set the vmtParent constant according to sizeof(SizeInt) instead of
SizeOf(ptruint), because the +size and -size fields are of type SizeInt and
  not ptruint or pointer.

git-svn-id: trunk@27540 -
2014-04-11 23:10:04 +00:00
sergei
b82b6da493 + Win32 SEH: to avoid memory leaks, it is necessary to free exception object for non-FPC exceptions on re-raise (it will be re-created by next exception handler).
git-svn-id: trunk@26241 -
2013-12-16 14:47:26 +00:00
sergei
179586f589 + SEH support for Win32. Enable by cycling with OPT=-dTEST_WIN32_SEH.
Although basic things work (no regressions in test suite, also with TEST_OPT=-O2), there are some secondary issues/TODOs:
- Exception frame around PASCALMAIN is not properly removed in DLLs
- No stack traces yet
- Stack overallocated in finalizer procedures, their entry/exit code needs cleanup
- Signals unit is probably completely broken.

git-svn-id: trunk@26225 -
2013-12-12 12:43:46 +00:00
nickysn
c1b0fb81f1 * updated all the RTL helper functions related to exceptions and stack traces to use codepointer instead of pointer
git-svn-id: trunk@25513 -
2013-09-17 21:25:26 +00:00
nickysn
728e8c62a7 * virtual method pointers in the objpas.TVmt record declared as codepointer; the vmtXXX constants also fixed
git-svn-id: trunk@25192 -
2013-07-30 23:02:32 +00:00
nickysn
ef2423128f * use CodePointer instead of Pointer in TObject.MethodName() and .MethodAddress() for i8086 medium memory model compatibility
git-svn-id: trunk@25152 -
2013-07-20 22:08:38 +00:00
nickysn
ad29cab0aa * DispCallByIDProc changed to CodePointer
git-svn-id: trunk@24842 -
2013-06-09 17:32:18 +00:00
nickysn
54c4c8155b + also added PCodePointer and PPCodePointer
git-svn-id: trunk@24841 -
2013-06-09 17:30:03 +00:00
nickysn
9b59809ac3 * TMethod.Code changed to CodePointer
git-svn-id: trunk@24840 -
2013-06-09 17:24:38 +00:00
paul
e4a6221bf3 compiler, rtl: add vtUnicodeString (issue #0018560)
git-svn-id: trunk@16833 -
2011-01-29 09:18:53 +00:00
tom_at_work
8a2696eb24 * limit the number of string message methods per class to 2^31 independent of architecture width: this avoids lots of compiler changes when allowing 2^63 (for 64 bit targets)
* fix string message method handling data structures to reflect this change, and also use the correct types for accessing them (longint vs. dword)
* output proper alignment code for string message method data structures to avoid issues on big-endian 64 bit architectures or architectures requiring proper alignment
* same for integer message methods; also, like string message method data structures, do not use packed records for them when accessing
* extend the test case (tw14145) do do multiple message dispatches, both integer and string ones, to complete successfully

git-svn-id: trunk@16254 -
2010-10-29 13:26:50 +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
ivost
a6022f5df2 * removed IImplementorGetter interface and replaced it by the guid IObjectReference.
* GetInterface and GetInterfaceWeak is modified so that when querying for IObjectReference not an interface is returned but the object pointer

git-svn-id: trunk@15087 -
2010-03-28 12:35:50 +00:00
ivost
dc785f6f68 * implemented intf as object. When doing IInterface as TObject the compiler calls fpc_intf_as_class to query for the IImplementorGetter interface and then invokes GetObject to get the
objects reference.
* by default the TInterfacedObject is supporting now IImplementorGetter

git-svn-id: trunk@15080 -
2010-03-28 00:17:20 +00:00
ivost
3b5826059d * Added GetInterfaceWeak to TObject. It's equal to GetInterface but the returned interface is not referenced. This way it's possible to query interfaces of unreferenced objects.
* Changed fpc_class_as_intf so that it uses GetInterfaceWeak instead of GetInterface. This way it's prevented that the AS operator is increasing the refcounter of an unreferenced object from 0 to 1 temporarily and then by decreasing from 1 to 0 the object is freed.

git-svn-id: trunk@15077 -
2010-03-27 17:00:52 +00:00
paul
ea8bf4f2fd rtl: TObject.SafeCallException and TComponent.SafeCallException has HResult return value. Fix default return value to catastrophic failure error code.
git-svn-id: trunk@14936 -
2010-02-25 04:13:52 +00:00
Jonas Maebe
870edaf916 * tobject.unitname and tobject.tostring have to return an ansistring instead
of a shortstring (mantis #15693)
  * changed tobject5 so it checks whether the return values are correct

git-svn-id: trunk@14869 -
2010-02-06 17:53:49 +00:00
florian
dab642986e * patch by Sergei Gorelkin, fixes several issues with implements, resolves #15209
git-svn-id: trunk@14466 -
2009-12-23 16:23:19 +00:00
paul
aa5a5e79ce merge revisions: 13909,13923,13924,13934,13935,13942,13943,13944,13946,13948,13950,13951,13952,13983,13994:
rtl: add enumerators to the basic classes
tests: add enumerators test which compiles and work both by fpc and dcc
compiler: 
  + start for-in loop implementation: implement for-in loop for types (enumerations and ranges), strings, arrays and sets. todo: perform type checking, optimize array and string loops - use temp for expression, implement for-in loop for classes
test:
  + add a simple test for the 'for-in' loop
compiler: fix string for-in loop. now it uses a temp variable to store string expression result
complier: fix for-in array loop. use a temp variable for the loop expression only if loop is not an open array loop
complier: continue enumerator implementation:
  + add operator enumerator which give an ability to add enumerator for an existent type (for example to override builtin string enumerator)
  + add class enumerator support via delphi compatible GetEnumerator method + enumerator class/object template (function MoveNext: Boolean; property Current)
  + tests
compiler: fix for-in loop for arrays. delphi does not copy arrays to a temp variable and it is possible to change array during loop. + test
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: enumerator directive support:
  + allow to mark methods and properties by 'enumerator MoveNext' and 'enumerator Current' modifiers. Parser checks return types and duplicates.
  + prefer *marked* by enumerator directive methods and properties than GetEnumerator and Current builtin symbols
  + increase ppu version
  + test
rtl: add IEnumerator and IEnumerable interfaces declarations
tests: for-in loop tests:
  + add small comment at the top of test program
compiler: allow 'enumerator MoveNext' for the interface function declaration + test
compiler: move all for-in loop helpers to the nflw unit
compiler: don't allow the compiler to choose the non-valid enumerator operator for the for-in loop

git-svn-id: trunk@14008 -
2009-11-02 03:24:48 +00:00
paul
dfef902c53 rtl: introduce new TObject methods: UnitName, GetHashCode, Equals, ToString added for compatibility with delphi 2009.
+ changes in compiler, utils, packages to resolve identifier conflicts with the new TObject methods (like changing of UnitName arguments to AUnitName, adding Classes. before the toString, etc). (issue #0014931)

git-svn-id: trunk@14005 -
2009-11-01 16:22:47 +00:00
florian
84c84b4964 + make TObject.Dispatch and DispatchStr virtual, patch by Paul Ishenin, resolves #14920
git-svn-id: trunk@13962 -
2009-10-28 19:22:29 +00:00
ivost
0438667eed * fixed bug #5800
* const s: string = icorbainterface; is possible now
* as operator is working now with corba interfaces
* supports helper function is working now with corba interfaces

git-svn-id: trunk@12729 -
2009-02-09 00:35:09 +00:00
ivost
0f519439b5 * reverted r12690 and r12691
* but extended ptconst so that a com interface maybe assigned to a TGuid const

git-svn-id: trunk@12692 -
2009-02-06 02:56:13 +00:00
ivost
7f2c77a407 * temporarly disabled GetInterface(iidstr: .... to keep fpc compiling
git-svn-id: trunk@12691 -
2009-02-06 01:37:52 +00:00