Commit Graph

43259 Commits

Author SHA1 Message Date
svenbarth
4a0d27ebfe Fix for Mantis #26271: Don't trash local variables that are used for the Default() intrinsic.
* ngenutil.pas, tnodeutils.trashable_sym:
    check for vo_is_default_var flag and don't consider such as trashable

+ added test

git-svn-id: trunk@27872 -
2014-06-06 13:59:52 +00:00
reiniero
a025a87c19 * fcl-db: test sql scanner: fix test case
git-svn-id: trunk@27871 -
2014-06-06 13:39:21 +00:00
svenbarth
1bbcc08a8b Fix for Mantis #26176. Don't handle "type helper" as unique.
ptype.pas:
  * read_named_type: change hadtypetoken from a value to a var parameter and set it to false if a type helper is parsed so that calling code does not handle it as unique
  * read_anon_type: handle that hadtypetoken is now a var parameter

pgenutil.pas, generate_specialization:
  * handle that hadtypetoken of read_named_type is now a var parameter

+ added test

git-svn-id: trunk@27870 -
2014-06-06 13:26:21 +00:00
svenbarth
9ab5affd55 Contrary to popular believe the VMT for a generic needs to be at least generated so that check for inherited methods can be done correctly. This does however not mean that the VMT is written to the object file which is handled at a completely different place. Fixes Mantis #26193.
pdecl.pas, types_dec:
  * invoke the VMT builder for generic classes as well

+ added test

git-svn-id: trunk@27869 -
2014-06-06 13:05:39 +00:00
reiniero
79d2abd1ca * fcl-db: sql parser test: test for create domain with check constraint, default and not null, a la
CREATE DOMAIN PRODTYPE AS VARCHAR(12)
         DEFAULT 'software'
         CHECK (VALUE IN ('software', 'hardware', 'other', 'N/A')) NOT NULL;

git-svn-id: trunk@27868 -
2014-06-06 12:59:01 +00:00
reiniero
9ee1ec412f * fcl-db: sql parser: fix failing STARTING WITH test committed in r27854
git-svn-id: trunk@27867 -
2014-06-06 12:45:42 +00:00
reiniero
02014da511 * fcl-db: cosmetic
git-svn-id: trunk@27866 -
2014-06-06 12:44:12 +00:00
reiniero
86e54269a0 * fcl-db: cosmetic
git-svn-id: trunk@27865 -
2014-06-06 12:43:56 +00:00
Károly Balogh
e89669bedc rewrite SpinLock to still work without the need to accidentally disable optimizations for a large part of the classes unit
git-svn-id: trunk@27864 -
2014-06-06 11:05:57 +00:00
reiniero
d3bb0d4a17 + fcl-db: add GUI for tests in testsqlscanner
git-svn-id: trunk@27863 -
2014-06-06 08:49:16 +00:00
Károly Balogh
df7af34de9 m68k: very early optimizer implementation experiments
git-svn-id: trunk@27862 -
2014-06-06 07:38:50 +00:00
svenbarth
639a59df92 Added support for partial specialization. This should fix a few problems with generics, the tests for which will be added in the next days after I've verified them.
For partial specialization only the declaration is reparsed, but not method bodies.

The way generic parameters are passed around inside the compiler is changed: instead of creating new type symbols we keep a (name,def) pair so that the code in insert_generic_parameter_types can decide whether it needs to add a type symbol (for new undefined defs) or not (for real types and undefined defs that were passed on from the parent generic). This required the tfpobjectlist type of the genericlist variables/parameters to be changed to tfphashobjectlist.

For correctly parsing Delphi specializations as parameters in functions of records (or objects) the relationship between the def and its typesym must already be established during the parsing. For this the checks for forcing a "type is not completely defined" message needed to be adjusted to correctly handle nested types as well. This should as a sideeffect also allow the usage of nested constants, etc like was fixed for classes some months ago.

ToDo: 
  - if a generic is specialized with only fully defined types then we could generate the in the unit where it's used. This is not yet done.
  - currently we don't specialize generics that are currently parsed; maybe this could be improved in the future for better type compatibility checks
  - check whether the pausing of token recording for partial specializations works correct in context of hint modifiers

pgenutil.pas:
  * parse_generic_parameters: return a tfphashobjectlist instead of a tfpobjectlist (requires a few type adjustments in various other declarations)
  * maybe_insert_generic_rename_symbol, insert_generic_parameter_types: change genericlist from tfpobjectlist to tfphashobjectlist
  * parse_generic_specialization_types_internal: use is_generic instead of checking for df_generic
  * generate_specialization:
      + add a nested function to disable the requirement to check for method bodies
      * use the "simple" parameter parsing only for error recovery
      * instead of already creating a new type symbol for a parameter we use the found symbol's name and its def and maybe create it later on (therefor the type of tfpobjectlist was changed to tfphashobjectlist)
      * a partial specialization is specialized into the symtable of the def it is specialized in instead of one of the two global symtables
      * for now we handle partial specializations of generics we are currently parsing like before
      * don't continue recording generic tokens while we do a partial specialization
      * use the new unset_forwarddef function on the newly created defs
  * insert_generic_parameter_types: only create a new type symbol if the found type symbol does not yet have an owner (thus was freshly created for this generic declaration)

pdecobj.pas, object_dec:
  * change type of genericlist from tfpobjectlist to tfphashobjectlist
  * set the type sym for all object types that can be generic or inside a generic (needed for correctly parsing Delphi style generic declarations)

pdecsub.pas, parse_proc_head:
  * consume_generic_interface: always generate the specialization name as now all generics are "specialized" inside a generic
  * the assumption that the def index numbers are the same is no longer true as the genericdef might contain the defs of partial specializations which are not generated for full specializations

pdecvar.pas, read_record_fields:
  * we also need to check nested types whether they contain a not yet completely parsed record or object

ptype.pas:
  * read_named_type: 
      * change genericlist from tfpobjectlist to tfphashobjectlist
      * pass the typesymbol along to record_dec
  * resolve_forward_types: use is_generic instead of checking for df_generic
  * single_type: 
      * use is_generic instead of checking for df_generic
      * no need to check generic parameters
  * parse_record_members:
      + add parameter for the record's type symbol
      * setup the typesym <=> def relationship
  + record_dec: add parameter for the type symbol and pass it to parse_record_members
  * read_named_type, expr_type: use is_generic instead of checking for df_generic
  * array_dec & procvar_dec: change genericlist from tfpobjectlist to tfphashobjectlist

symdef.pas, tstoreddef:
  * improve the checks used in is_generic and is_specialization to really only work on true generics and true (and partial) specializations respectively
  * don't search the type parameters in the symtable, but store them in the PPU and load them from there
  - remove fillgenericparas method (including the calls in the descendants tarraydef, tprocvardef, tobjectdef and trecorddef)

defcmp.pas, compare_defs_ext:
  * handle partial specializations: specializations with only undefineddefs are compatible to generic defs

pdecl.pas, types_dec:
  * switch generictypelist from tfpobjectlist to tfphashobjectlist

ppu.pas:
  * increase PPU version

+ added tests that ensure that "not completely defined" checks for records (and objects) still work correctly

git-svn-id: trunk@27861 -
2014-06-05 20:05:05 +00:00
sergei
bcddc40150 * powerpc64: removed references to global variables 'cg' (it is implicit 'self' in methods of tcg descendants) and 'current_asmdata.currasmlist' (the asmlist to use is passed as argument).
git-svn-id: trunk@27860 -
2014-06-05 16:06:36 +00:00
Károly Balogh
0fe656e82d m68k: simplified code generated by g_concatcopy and cleaned up the old mess from the code
git-svn-id: trunk@27859 -
2014-06-05 12:42:36 +00:00
lacak
feff396633 fcl-db: sqldb: simplify code, remove unused field (FSQLBuf)
git-svn-id: trunk@27858 -
2014-06-05 10:42:23 +00:00
sergei
217ab9879c * Enabled internal handling of Abs(longint) for all targets. It has been implemented in cross-platform way ages ago (see tcginlinenode.second_abs_long), but not enabled on MIPS,SPARC and m68k.
- RTL: removed MIPS,SPARC and m68k-specific implementations of Abs(longint), and marked the generic one as  required for bootstrapping purposes only.

git-svn-id: trunk@27857 -
2014-06-05 10:35:51 +00:00
reiniero
c853c29c3c * fcl-db: cosmetic
git-svn-id: trunk@27856 -
2014-06-05 10:33:44 +00:00
reiniero
c13396ad0a * fcl-db: cosmetic
git-svn-id: trunk@27855 -
2014-06-05 10:21:41 +00:00
reiniero
493d38ff95 * fcl-db: sqlparser: test domain creation with check constraint like CHECK (VALUE STARTING WITH 'V');
Test currently fails: line 1, pos 53: Unexpected token: WITH

git-svn-id: trunk@27854 -
2014-06-05 08:43:43 +00:00
reiniero
7275f30360 * fcl-db: readme for sql parser/scanner/lexer; based on Michael's message http://www.mail-archive.com/fpc-devel%40lists.freepascal.org/msg18680.html
git-svn-id: trunk@27853 -
2014-06-05 08:15:37 +00:00
sergei
c76dedfd31 * MIPS: re-enable peephole optimizations which got disabled by r27106 and were not restored in r27147. Unfortunately such things are hard to detect reliably in automated way.
git-svn-id: trunk@27852 -
2014-06-04 22:34:46 +00:00
nickysn
70732aedbb * ti8086nodeutils.InsertMemorySizes: stack segment creation moved to a separate
method

git-svn-id: trunk@27851 -
2014-06-04 13:44:10 +00:00
sergei
886159e73a * Renamed testdll2.pp into ttdllex1.pp so it falls into same chunk with ttdllexe.pp and can be located at runtime.
git-svn-id: trunk@27850 -
2014-06-04 12:30:35 +00:00
sergei
128cdd2a65 * Renamed testdll.pp into ttdlltes1.pp so it falls into same chunk with ttdlltest.pp and can be located at runtime.
git-svn-id: trunk@27849 -
2014-06-04 12:10:51 +00:00
sergei
bdb2993277 * Renamed tlib* tests so all file names of dependent tests differ only in last letter. This fixes failures caused by inability to locate dlls at runtime.
git-svn-id: trunk@27848 -
2014-06-04 11:53:07 +00:00
sergei
4202343033 * MIPS: emit ".set nomips16" and ".set noreorder" directives for procedures declared as "assembler nostackframe", as it is done for regular procedures. Handwritten assembler routines typically utilize delay slots, and it is desirable that assembler does not mess it up.
git-svn-id: trunk@27847 -
2014-06-04 00:26:44 +00:00
michael
6c7ab322a1 * Applied patch from Laco to fix bug ID #25939
git-svn-id: trunk@27846 -
2014-06-03 11:45:22 +00:00
michael
2e8e50a24b * Applied patch from Laco to fix bug ID #25939
git-svn-id: trunk@27845 -
2014-06-03 11:43:58 +00:00
lacak
ae3f0f3752 fcl-db: base: introduce TParam.AsBytes + test
(FDataType is set to ftVarBytes intentionally due to Delphi compatibility)

git-svn-id: trunk@27844 -
2014-06-03 08:33:09 +00:00
lacak
62782f1904 fcl-db: tests: some tests expects, that GetNDataset (FPDEV table) returns records ordered by ID. In some cases when in test record is updated (f.e. TestRefresh) this record appears at end when dataset is reopened.
(ATM this is case of PostgreSQL only, where 2 tests fails - false negative)

git-svn-id: trunk@27843 -
2014-06-02 10:36:41 +00:00
Jonas Maebe
bee20f79f0 * save original widestring manager on entry and restore it on exit, so that
units finalized afterwards won't try to use the finalized cwstring
    manager (mantis #26252)

git-svn-id: trunk@27842 -
2014-06-01 18:30:49 +00:00
nickysn
a52d8abe38 * changed the default stack size in the i8086 far data memory models to 16 KB
git-svn-id: trunk@27841 -
2014-06-01 14:38:54 +00:00
Jonas Maebe
02d36c56f7 * fixed compilation (changes after testing :/ )
git-svn-id: trunk@27840 -
2014-06-01 14:34:47 +00:00
Jonas Maebe
5bc6a2e934 * synchronised JVM versions of generic include files with current generic
versions

git-svn-id: trunk@27839 -
2014-06-01 14:13:40 +00:00
Jonas Maebe
5e1a895e95 * removed JVM-specific creation of methodpointertype and
nestedprocpointertype; this was done initially before the JVM target knew
    about the voidpointertype, but is no longer necessary (also fixes
    mantis #26251)

git-svn-id: trunk@27838 -
2014-06-01 14:13:36 +00:00
sergei
274c2fc82f * handle_ln_const: if/else branches were swapped, correct values are: ln(0)=-Inf and ln(-#)=NaN.
* handle_ln_const and handle_sqrt_const handle all arguments, not just invalid ones, so calling code can be simplified.

git-svn-id: trunk@27837 -
2014-06-01 01:20:06 +00:00
marco
aebe66d0cf * some fixes and a lot of updating of Hungarian names. Mantis #26196
git-svn-id: trunk@27836 -
2014-05-31 15:44:58 +00:00
marco
b7aff4eae0 * flush output on halt. Patch by Mattias mantis #26225
git-svn-id: trunk@27835 -
2014-05-31 15:06:42 +00:00
marco
0a0739b916 * improved winexec comment, updated copyright year and add minor comment to gettickcount64
Mantis #26238

git-svn-id: trunk@27834 -
2014-05-31 14:47:31 +00:00
sergei
a8bc2085e8 - Delete strpas.inc files, no longer used, their contents has been merged into corresponding $(CPU).inc.
git-svn-id: trunk@27833 -
2014-05-31 00:49:40 +00:00
sergei
e5f6f9c3a1 - powerpc and powerpc64: cleaned out code corresponding to FPC_STRTOSHORTSTRINGPROC not defined (obsolete and removed from other targets long ago). Also merged strpas.inc files into powerpc*.inc, because by now they are included only once and therefore don't need to be separate files.
git-svn-id: trunk@27832 -
2014-05-31 00:45:21 +00:00
sergei
a94187c79b - ARM: cleaned out code corresponding to FPC_STRTOSHORTSTRINGPROC not defined (obsolete and removed from other targets long ago).
git-svn-id: trunk@27831 -
2014-05-31 00:38:01 +00:00
reiniero
e8a3715afd * fcl-db: limit blob memory usage when using unidirectional datasets. Patch by Laco. Issue #24509
git-svn-id: trunk@27830 -
2014-05-30 11:07:53 +00:00
Jonas Maebe
19c310f5d3 * fixed unit name
git-svn-id: trunk@27829 -
2014-05-30 07:25:04 +00:00
Károly Balogh
f3bbad26c3 m68k: use MOVEA without size to load values to address regs. use a_op_const_reg in a_op_const_ref for smarter const loading when necessary
git-svn-id: trunk@27828 -
2014-05-30 05:29:22 +00:00
nickysn
47a7a9835a * added hack to support stack exceeding 32kb in size in the i8086 far data
memory models

git-svn-id: trunk@27827 -
2014-05-29 17:07:01 +00:00
svenbarth
2c6d3f1428 Read the deref of the fieldvarsym into the correct variable. I wonder how this ever went past the test suite O.o
symsym.pas, tstaticvarsym.ppuload:
  * read the deref of the fieldvarsym into fieldvarsymderef, not defaultconstsymderef

git-svn-id: trunk@27826 -
2014-05-29 16:24:47 +00:00
nickysn
e9cb275f66 * put the i8086-msdos stack segment in a separate object file
git-svn-id: trunk@27825 -
2014-05-29 16:04:15 +00:00
nickysn
d4565aeec2 * in i8086 far data memory models add reference to the beginning of stack from
the startup code, so the object module, containing the stack segment doesn't
  get smartlinked away

git-svn-id: trunk@27824 -
2014-05-29 14:57:48 +00:00
Jonas Maebe
03ef4b6477 + test for mantis #26226 (already works with FPC 2.7.1)
git-svn-id: trunk@27823 -
2014-05-29 12:19:27 +00:00