Commit Graph

50360 Commits

Author SHA1 Message Date
michael
301e6a8b06 * Patch from Mattias gaertner:
- type cast class-of
  - type cast Self in class method
  - bark on statement without call, e.g. "i;"
  - mode delphi procedure types
  - give each message an unique id

git-svn-id: trunk@35470 -
2017-02-22 20:56:56 +00:00
michael
8def379f49 * Patch from Mattias Gaertner: fixed creating binary element for "as" operator
git-svn-id: trunk@35469 -
2017-02-22 20:56:11 +00:00
michael
b456092739 * Patch from Mattias Gaertner: fixed TStreamResolver.FindStreamReader getting a stream twice
git-svn-id: trunk@35468 -
2017-02-22 20:55:22 +00:00
michael
7ff70cbe6e * Fix bug ID #22107
git-svn-id: trunk@35467 -
2017-02-22 19:50:55 +00:00
marco
ef26fbd83d * attributes longword, mantis #30800
git-svn-id: trunk@35466 -
2017-02-22 16:52:46 +00:00
lacak
0c06318dda fcl-db: fpmake: build oracleconnection also for Win64 target. Bug#31430
git-svn-id: trunk@35465 -
2017-02-22 14:03:42 +00:00
pierre
40b76f686c Add -CTsmalltoc option for powerpc64-aix compiled IDE
git-svn-id: trunk@35464 -
2017-02-21 16:46:20 +00:00
maciej-izak
533c89e128 * New test for management operators to detect regressions like regression fixed in r35461 (many times initialized global variables)
git-svn-id: trunk@35463 -
2017-02-21 14:20:15 +00:00
Jonas Maebe
b86f2d7e3c * only initialize global regvars in unit and main program init code
(bug in r35461)

git-svn-id: trunk@35462 -
2017-02-21 07:37:15 +00:00
Jonas Maebe
cadf177a93 * fixed bugs in r33737: that revision was supposed to only move
code from one unit to another, but in splitting some methods
    I made a couple of mistakes :/ (causing global variables to be
    initialised three times)

git-svn-id: trunk@35461 -
2017-02-20 22:15:34 +00:00
florian
a80fcb74d8 * make test working for architectures with no float and ansistring support
git-svn-id: trunk@35460 -
2017-02-19 22:29:52 +00:00
Jonas Maebe
1c985f0a43 * fixed bzip2 units for big endian targets (not optimal, but simplest fix)
git-svn-id: trunk@35459 -
2017-02-19 22:27:49 +00:00
Jonas Maebe
1b42affa8f * optimized PowerPC version of changes in r35454
git-svn-id: trunk@35458 -
2017-02-19 20:27:39 +00:00
florian
99a0c2464d * version update
git-svn-id: trunk@35457 -
2017-02-19 19:15:19 +00:00
florian
e7fd71db36 + write name of segment/group which is too large
git-svn-id: trunk@35456 -
2017-02-19 19:15:18 +00:00
florian
c4fe4ab1f5 * correctly handle push <imm> on 80186+
git-svn-id: trunk@35455 -
2017-02-19 19:15:16 +00:00
florian
7213a13081 * split fpc_mul_<64 bit> into separate procedures with and without overflow checking
git-svn-id: trunk@35454 -
2017-02-19 19:15:14 +00:00
maciej-izak
3900ccf260 * Rename RecordOp to ManagementOp (more relevant name)
git-svn-id: trunk@35453 -
2017-02-19 18:06:54 +00:00
maciej-izak
92c0e57c59 * Test suite for management operators. We have management operators on trunk! Enjoy ^^
git-svn-id: trunk@35452 -
2017-02-19 14:34:09 +00:00
maciej-izak
4154b4ca8a * Call management operators also for records with zero-size. For that purpose was changed function RTTISize. New name for RTTISize is RTTISizeAndOp. RTTISizeAndOp can return size of required type and information about existing management operators for that type in current context (to determine context is used enum TRTTIRecOpType which is passed also as parameter in RTTISizeAndOp). RTTISizeAndOp is used in fpc_initialize_array, fpc_finalize_array, fpc_addref_array and CopyArray.
git-svn-id: trunk@35451 -
2017-02-19 13:20:43 +00:00
maciej-izak
0cff9fe83c * Call management operator (Initialize) for records when SetLength for dynamic arrays is used.
git-svn-id: trunk@35450 -
2017-02-19 12:47:31 +00:00
maciej-izak
5a7d4eb25f * Call management initialize operator for records inside classes (record with management operators as field) (rtl/inc/objpas.inc, TObject.InitInstance)
git-svn-id: trunk@35449 -
2017-02-19 12:17:20 +00:00
maciej-izak
9a9eb1b840 * Use RTTIRecordRttiInfoToInitInfo (when FPC_HAS_MANAGEMENT_OPERATORS is not defined) for records/objects in fpc_Copy as well as for fpc_Initialize, fpc_finalize, fpc_Addref
git-svn-id: trunk@35448 -
2017-02-19 11:53:52 +00:00
maciej-izak
8a68a7aea8 * Declare field RecordOp for TRecordInfoInit only when FPC_HAS_MANAGEMENT_OPERATORS is defined, same for additional types for management operators.
git-svn-id: trunk@35447 -
2017-02-19 01:26:08 +00:00
maciej-izak
d42428bc3c * Initial support for management operators in RTL (rtl/inc/rtti.inc):
* fpc_Initialize: Initialize operator is called after recordrtti(data,typeinfo,@int_initialize);
  * fpc_Finalize: Finalize operator is called before recordrtti(data,typeinfo,@int_finalize);
  * fpc_Addref: AddRef operator is called after recordrtti(data,typeinfo,@int_addref);
  * fpc_Copy: Copy operator (if exists) is called instead of default copy behavior
  * replace RTTIRecordRttiInfoToInitInfo function (which was introduced only to speed-up InitializeArray/FinalizeArray) with a more advanced RTTIRecordOp function. Result of RTTIRecordRttiInfoToInitInfo is now returned in initrtti parameter. Additionally as new result is returned PRecordInfoInit which is usefully in basic RTL functions: fpc_Initialize, fpc_Finalize, fpc_Addref, fpc_Copy

git-svn-id: trunk@35446 -
2017-02-19 01:18:35 +00:00
maciej-izak
af8e0efe57 * Rtti info about Management Operators (MO) in init table for records. Note: commit contains minimal changes for RTL (for proper "make") no functional changes. More RTL changes for fully functionally MO in next commits.
compiler/ncgrtti.pas
  + write_record_operators procedure which fills simple VMT like table for MO.
  * recorddef_rtti save MO (if exists)
  * objectdef_rtti_fields save nil pointer/entry for objects rtti (have same RTL parts like for records)

compiler/options.pas
  + new define FPC_HAS_MANAGEMENT_OPERATORS

compiler/symconst.pas
  + new item itp_init_record_operators for tinternaltypeprefix enum
  + new entry '$init_record_operators$' in internaltypeprefixName

rtl/inc/rtti.inc
  + new field RecordOp (pointer to MO VMT table) in TRecordInfoInit
  + new types to handle MO VMT: TRTTIRecordOpVMT, PRTTIRecordOpVMT, TRTTIRecCopyOp, TRTTIRecVarOp

rtl/objpas/typinfo.pp
  + RecordOp field for TRecInitData record

git-svn-id: trunk@35445 -
2017-02-19 00:22:59 +00:00
maciej-izak
25db29d0a6 * symtable.pas:
+ search_management_operator function to find Tprocdef for selected management operator in record definition

tokens.pas:
  + new constants: first_managment_operator and last_managment_operator used in search_management_operator

git-svn-id: trunk@35444 -
2017-02-18 19:27:53 +00:00
maciej-izak
9441fb3968 * ngenutil.pas, tnodeutils.sym_maybe_initialize: Ensure that management operator (Initialize) is used also for local variables.
git-svn-id: trunk@35443 -
2017-02-18 19:19:46 +00:00
maciej-izak
520bb31fa6 * Parse management operators. Each management operator is special kind of operator without result.
git-svn-id: trunk@35442 -
2017-02-18 19:12:48 +00:00
maciej-izak
168e59837a * New function token2managementoperator for conversion: ttoken to tmanagementoperator
git-svn-id: trunk@35441 -
2017-02-18 18:58:32 +00:00
maciej-izak
b912deae33 * each record with managed field or with any management operator needs init table (update for symdef.pas, trecorddef.needs_inittable)
git-svn-id: trunk@35440 -
2017-02-18 18:50:57 +00:00
maciej-izak
15ba9b54c6 Store informations about management operators in ppu files for records.
ppu.pas:
  * increase ppu version

symconst.pas:
  + new enum tmanagementoperator and set tmanagementoperators

symtable.pas, trecordsymtable:
  + new field managementoperators
  + new method includemanagementoperator

symdef.pas, trecorddef.ppuload and trecorddef.ppuwrite:
  * save/load for managementoperators

git-svn-id: trunk@35439 -
2017-02-18 18:43:25 +00:00
maciej-izak
48b149acd4 New tokens for new management operators: Initialize, Finalize, AddRef and Copy. Small code adjustment for parser (pdecobj.pas, pstatmnt.pas, psub.pas, ptype.pas) was required because few of old token has from now value which is outside range of set: _CONSTRUCTOR, _FINALIZATION.
New tokens for operators:
  * _OP_INITIALIZE, _OP_FINALIZE, _OP_ADDREF, _OP_COPY

New tokens:
  * _INITIALIZE, _FINALIZE, _ADDREF, _COPY

git-svn-id: trunk@35438 -
2017-02-18 18:12:45 +00:00
pierre
3f8f7bc04a Regenerate Makefile after: Add explicit rule for uuchar unit
git-svn-id: trunk@35437 -
2017-02-16 18:24:33 +00:00
pierre
31d9be0c9d Add explicit rule for uuchar unit
git-svn-id: trunk@35436 -
2017-02-16 18:24:14 +00:00
michael
00450470e2 * Make port not stored, since it is in params already
git-svn-id: trunk@35435 -
2017-02-14 21:17:38 +00:00
Tomas Hajny
12dddfb6c8 * fix base path handling - ensure using full path in the cfg files and avoid double slashes
git-svn-id: trunk@35433 -
2017-02-13 00:03:15 +00:00
florian
3d6d5145bf * fix handling of const string symbols in preprocessor expressions
+ accept string constants in preprocessor expressions, resolves #31246

git-svn-id: trunk@35432 -
2017-02-12 17:29:45 +00:00
Tomas Hajny
0276bb374d * remove duplicated SDL sources entry
git-svn-id: trunk@35431 -
2017-02-12 17:10:01 +00:00
florian
c961c72c30 * tarmtypeconvnode.first_int_to_real should call the generic method in the parent class, if soft fpu code is generated, resolves #31350
git-svn-id: trunk@35430 -
2017-02-12 16:05:13 +00:00
michael
7702ebb261 * Patch from Mattias Gaertner; SetCharAt
git-svn-id: trunk@35429 -
2017-02-12 15:17:12 +00:00
michael
bc22805000 * Patch from Mattias Gaertner:
pastree: 
    - allow custom data to be chained.
  pparser:
    - procedure modifier assembler
    - Self[]
    - Self.member
    - fixed some wrong parents
  pasresolver:
    - aString[i]:=
    - check proc external modifier
    - test if WithExprScope is set
    - Self[]
    - Self.member
  fppas2js:
    - proc assembler modifier
    - assigned(class-instance)
    - class default property
    - low(array), high(array)
    - multi dim arrays [index1,index2] -> [index1][index2]
    - string: read and write char aString[]
    - procedure modifier external name 'funcname'
    - option to add "use strict";
    - with-do using local var
    - with record do i:=v;
    - with classinstance do begin create; i:=v; f(); i:=a[]; end;
    - Self[]
    - Self.member

git-svn-id: trunk@35428 -
2017-02-12 15:16:00 +00:00
joost
09f415dc81 * Refactored so that TFPCustomPackagesStructure has access to the (compiler-)options
git-svn-id: trunk@35427 -
2017-02-12 14:18:20 +00:00
Jonas Maebe
015f034904 * reverted r35424, wasn't ready for commit yet
git-svn-id: trunk@35426 -
2017-02-11 21:21:44 +00:00
Jonas Maebe
265c8e7bbc + support for specifying ms_abi_default, ms_abi_cdelc, sysv_abi_default, and
sysv_abi_cdecl calling conventions on x86-64 to force using the SYSV/
    Microsoft ABI on platforms that don't use it by default (mainly to ease
    porting pure assembler routines)

git-svn-id: trunk@35425 -
2017-02-11 19:57:12 +00:00
Jonas Maebe
4d9617da97 * fixed check to determine whether a record parameter can be subscripted
directly in inline assembly: that's only possible if it's a register
    parameter where the address of the record was passed (rather than the
    record itself)

git-svn-id: trunk@35424 -
2017-02-11 19:57:08 +00:00
michael
dc500f7276 * Support for exact YearsBetween calculation (bug ID 31233)
git-svn-id: trunk@35423 -
2017-02-11 15:18:37 +00:00
michael
268693f0d5 * Support for exact MonthsBetween calculation (bug ID 31354)
git-svn-id: trunk@35422 -
2017-02-11 15:13:11 +00:00
michael
3bd8da04c7 * Better check for empty Refresh SQL statement
git-svn-id: trunk@35421 -
2017-02-11 14:03:38 +00:00
michael
89c2d0a9dc * Fix AVs when no description nodes available
git-svn-id: trunk@35420 -
2017-02-11 10:10:59 +00:00