Commit Graph

2924 Commits

Author SHA1 Message Date
svenbarth
7dfaec7a05 Fix for Mantis #21457
* pdecsub.pas, parse_proc_dec & pdecobj.pas, constructor_head: 
    correctly set the return type of the constructor of a class helper to the extended def
* psub.pas, generate_bodyentry_block:
    call the NEWINSTANCE of the extended class for constructors of class helpers

git-svn-id: trunk@21582 -
2012-06-12 09:42:22 +00:00
Jonas Maebe
50659b7e7f * give an error if a routine definition defines default values for
parameters that do not appear in forward/interface definitions
    (mantis #19434)
  * added test for #17136 already works

git-svn-id: trunk@21524 -
2012-06-07 22:36:39 +00:00
Jonas Maebe
572012fad3 * mark units as used in case only static symbols from inside object,
record or enum symtables are used (such as class helper methods)
    (mantis #21808)

git-svn-id: trunk@21512 -
2012-06-06 20:16:50 +00:00
Jonas Maebe
12553a9367 * don't give -CO warnings or hints for ordinal constants, because those
are already checked by range checking (and were checked wrongly by -CO
    checking) (mantis #19581)

git-svn-id: trunk@21504 -
2012-06-06 19:28:22 +00:00
Jonas Maebe
9412d4abd2 * add a reference to the procsym corresponding to the chosen overloaded
procdef, so that the unit containing it is marked as "used" (mantis #15966)

    Even better would be if the unit containing the originally found procsym
    were not also marked as used, but that would require a significant
    rewrite (all symbols found using symboltable helpers are automatically
    marked by those routines)

git-svn-id: trunk@21501 -
2012-06-06 18:46:01 +00:00
svenbarth
aa0f1bdf26 pdecl.pas, readconstant: If we are parsing a constant declaration in a generic and we encounter an intrinsic then this intrinsic is left as is (thus the node p returned by comp_expr will be a inlinen instead of an expected ordconstn, stringconstn, etc.). Nevertheless we need to create a symbol for the constant (which isn't done otherwise). In the case of SizeOf a constant "0" will be created. This fixes Mantis #21593.
git-svn-id: trunk@21498 -
2012-06-06 15:00:28 +00:00
svenbarth
7332a0f801 ninl.pas, tinlinenode.pass_typecheck: an intrinsic which has a generic type parameter as argument is left as is (e.g. a call) and thus this needs to be respected when typechecking a SizeOf. Fixes Mantis #21592.
git-svn-id: trunk@21497 -
2012-06-06 14:41:12 +00:00
svenbarth
bf9cb352b3 ptype.pas, single_type: If the generic dummy type is used in mode Delphi then generate an error. This fixes Mantis #21363.
git-svn-id: trunk@21496 -
2012-06-06 13:15:18 +00:00
Jonas Maebe
04df0d537e * more finegrained parallelism support for testsuite runs: the tests are no
longer split per directory, but in chunks of 100 tests (configurable via
    the new CHUNKSIZE=xxx Makefile parameter), which then all can be checked
    in parallel
   o dependencies between tests are handled by always putting tests whose
     name is the same except for the last character into the same chunk
   o as previously, -jx can only be used for the "all" target, other targets
     cannot be executed in parallel
   o the "units" directory has been renamed "tstunits" because otherwise
     "make distclean" will remove it entirely now that the main tests
     makefile also compiles a program

git-svn-id: trunk@21479 -
2012-06-03 17:56:28 +00:00
marco
bc56239af7 * removed checkcvs. We stopped using CVS 7 years ago, and don't check $Log:'s
that often anymore. There is nothing worth keeping from this source (which is by me btw)

git-svn-id: trunk@21470 -
2012-06-03 11:16:17 +00:00
Tomas Hajny
6c6d2489d1 + test for ExpandFileNameCase added
git-svn-id: trunk@21468 -
2012-06-02 22:37:30 +00:00
svenbarth
a7f95382b6 Added test for Mantis #15683 which seems to be fixed already.
git-svn-id: trunk@21450 -
2012-06-01 12:01:18 +00:00
svenbarth
22d1a8bbab Improve NativeNT RTL (tested on Windows 7)
* fix DirectoryExists which didn't yet work without System privileges
* fix FileExists which didn't use the correct access flags
+ implement FindFirst/FindNext/FindClose which is conceptually based on the Find-mechanism of the Unix RTL as for the object hierarchy I can't use the same mechanism that Windows provides for filesystems (the function NtQueryDirectoryFile provides the possibility to pass a pattern, but I'm not using that functionality; maybe I'll update FindNext in the future to use this for speed up...). Note: The PChar "workaround" is needed, because string reallocation does currently not work... (maybe Reallocmem is buggy)
- remove FindMatch which is only provided by Windows SysUtils and DOS units
+ add functions/constants/types which are used by Find* to the NDK includes
- remove "packed" from file information types (Windows 7 didn't like the size otherwise)

git-svn-id: trunk@21438 -
2012-05-31 07:18:13 +00:00
Jonas Maebe
f8cb3fbfef + old tests I forgot to commit
git-svn-id: trunk@21429 -
2012-05-29 09:01:55 +00:00
florian
7cc227be17 . remove obsolete tests
git-svn-id: trunk@21415 -
2012-05-28 14:34:55 +00:00
Jonas Maebe
252483ffd8 + support for running the testsuite in parallel. Note that only the "all"
target can be run in parallel, so "clean", "digest" and/or "dbdigest"
    have to be run in separate make invocations if you wish to use -j for
    running the testsuite

git-svn-id: trunk@21406 -
2012-05-28 09:14:56 +00:00
Jonas Maebe
a2426178dc * don't insert type conversions in add nodes if both arguments are constant
and if the result does not depend on the types of the arguments (to
    prevent "qwordconst>int64const" being turned into
    "int64(qwordconst)>int64const" and thereby potentially change the outcome)
    (mantis #19622)

git-svn-id: trunk@21395 -
2012-05-26 14:14:59 +00:00
Jonas Maebe
9e0184884e * correctly change the signdness information of tordconstnodes that are
simplified via typeconvnode (corrects resultdef of "qword(1) shl 33",
    mantis #22133)
  * simplify shl/shr nodes after their resultdef has been set, so the
    resultdef used during simplify is set (fixes same expression as above
    when it is calculated by an inline function)

git-svn-id: trunk@21394 -
2012-05-26 13:31:23 +00:00
marco
ced0992642 * extraction example by Reinier Olislagers. Mantis #21304
git-svn-id: trunk@21387 -
2012-05-24 19:26:22 +00:00
florian
638d0d49c0 + take advantage of the mla instruction when calculating array offsets
git-svn-id: trunk@21375 -
2012-05-23 20:48:26 +00:00
pierre
312c6bb7f8 x86_64 subdirectory added
git-svn-id: trunk@21370 -
2012-05-23 09:09:46 +00:00
svenbarth
dbc410de63 Allow the usage of a generic's name without type arguments inside of nested classes inside the generic. This fixes Mantis #19499, but also Mantis #18688.
* symtable.pas:
    + add function "get_generic_in_hierarchy_by_name" which returns a def with the name of the symbol in the given object/record hierarchy (useful only in non-Delphi modes)
    + add function "return_specialization_of_generic" which returns the specialization def of a given class inside the given object/record hierarchy
* pexpr.pas, factor, factor_read_id: instead of checking whether the names of the found symbol and the current_structdef are equal, check whether the generic appears in hierarchy of current_structdef
* ptype.pas:
    * id_type: check whether the found symbol is a generic dummy and we are currently parsing a generic then return the correct def of the generic instead of the dummy one
    * single_type: when using the generic type without type parameters the def must resolve to the specialized def when specializing the class instead of the generic def which the dummy symbol points to
    * read_named_type, expr_type: like in "single_type" we need to resolve the use of the parameterless type name to the correct specialization def instead of the generic def
* pdecobj.pas, object_dec: also set the typesym of the current_structdef as otherwise some assumptions about generics with the above mentioned changes aren't valid anymore (like the def the typesym is unset again afterwards)
+ add tests for both bug reports (the one for 19499 is slightly modified so that it does not contain any errors)

git-svn-id: trunk@21361 -
2012-05-22 12:19:11 +00:00
Jonas Maebe
1ec48299cf * allow default() on Objective-C classes and protocols: the compiler already
allows it, and they're plain pointer-based types -> nil is fine

git-svn-id: trunk@21360 -
2012-05-22 11:07:05 +00:00
Jonas Maebe
78bb3e323a * fixed source type information for values loaded in arrayconstructor after
r21069

git-svn-id: trunk@21350 -
2012-05-20 20:34:14 +00:00
florian
21573f50c5 * allow LOC_CONSTANT to be used as vmt pointers in the cg, resolves #21914
git-svn-id: trunk@21349 -
2012-05-20 19:02:36 +00:00
Jonas Maebe
eb7e192226 * support pointer constants as initialisation values for procvar typed
constants in Delphi mode on non-treetypedconstbuilder platforms
    (mantis #21267)

git-svn-id: trunk@21344 -
2012-05-20 14:51:15 +00:00
florian
1294ea4357 * patches by Max Nazhalov to solve some issues with currency formatting, resolves #18704 and #22063
git-svn-id: trunk@21339 -
2012-05-19 14:54:46 +00:00
florian
6c8eed21c4 + implement auto inlining (-Ooautoinline)
+ implement trashing of local variables if subroutine is inlined
* fix some errors releated to interproc. gotos and inlining
+ node_count function
* inline cannot be used with iochecking and safecall calling conventions
* track inherited usage
* don't inline if inherited is used

git-svn-id: trunk@21335 -
2012-05-19 13:30:02 +00:00
michael
0efa458127 * Add PostGres Event notification component from Ludo Brands (22060)
git-svn-id: trunk@21324 -
2012-05-18 12:19:09 +00:00
michael
137b21223b * Add Event notification component from Ludo Brands (22060)
git-svn-id: trunk@21323 -
2012-05-18 12:13:48 +00:00
svenbarth
fb3777b9a0 + add test for Mantis #19511 which seems to be fixed already...
git-svn-id: trunk@21315 -
2012-05-17 08:59:50 +00:00
paul
4312aa4e08 compiler: allow compiler to find real class definition during class members parse to handle references to self constants + test
git-svn-id: trunk@21290 -
2012-05-14 04:50:49 +00:00
Jonas Maebe
edd42aa42a * moved subsetref/reg and bit_set/test support from cgobj to hlcgobj for
future use by high level code generator targets
   o this in turn required that all a_load*_loc* methods are called via
     hlcg rather than via cg, since a location can be a subsetref/reg and
     and those are no longer handled in tcg
   o that then required moving several force_location_* routines into
     thlcg because they use a_load_loc*, but did not take tdef size
     parameters (which are required by the thlcg a_load_loc* routines)
   o the only practical consequence is that from now on, you have to
     use hlcg.location_force_mem/reg() (fpureg not yet) and
     hlcg.gen_load_loc_cgpara() instead of the removed versions from ncgutil,
     and hlcg.a_load*loc*() instead of cg.a_load*loc* if a subsetref/reg
     might be involved

git-svn-id: trunk@21287 -
2012-05-13 12:33:10 +00:00
michael
264a013087 * Example from Reinier Olislagers to demo TFBAdmin component (bug 22012)
git-svn-id: trunk@21277 -
2012-05-12 12:19:45 +00:00
michael
3296858f44 * Added TFBAdmin component from Ludo Brands (bug 22012)
git-svn-id: trunk@21276 -
2012-05-12 12:15:56 +00:00
paul
62a91ef626 compiler: don't search symbol in other symtables than in found nested class, fix wrong test + add another one
git-svn-id: trunk@21275 -
2012-05-12 08:21:50 +00:00
paul
62b59235ca compiler: fix accessing typed constants inside class declaration (bug #21941)
git-svn-id: trunk@21273 -
2012-05-12 01:09:56 +00:00
svenbarth
4fc7515591 * pdecsub.pas, parse_proc_dec: always parse operator overload heads as block type bt_body so that operators like ">", "=>" or "<>" are resolved to the correct tokens ("<>" would be a sequence of "_LSHARPBRACKET _RSHARPBRACKET" instead of _NE otherwise). Fixes Mantis #21127
git-svn-id: trunk@21266 -
2012-05-09 12:32:34 +00:00
joost
e2d43a63b2 * Added Lazarus gui-frontend for db unit-tests.
git-svn-id: trunk@21253 -
2012-05-08 10:22:39 +00:00
svenbarth
5b1b194b47 * pdecvar.pas, read_record_fields: don't generate BSS-data for generic static fields (doesn't fix any specific bug, but we don't need space reserved for the field)
* pgenutil.pas, generate_specialization: fix a stupid "don't iterate upwards if deleting/extracting" mistake (twice!); this fixes Mantis #21550 and Mantis #21654 (tests added)

git-svn-id: trunk@21251 -
2012-05-08 07:31:37 +00:00
Jonas Maebe
50d2fa7134 * after changing a modeswitch, only change related module/localswitches that
depend on the modeswitch that was just changed (so that e.g. changing
    the nested procvars setting has no effect on the state of $h+/$h-)
    (mantis #21951)

git-svn-id: trunk@21247 -
2012-05-06 14:56:49 +00:00
florian
69ce5fa66b * patch by Max Nazhalov to improve real2str performance, resolves #21825
git-svn-id: trunk@21236 -
2012-05-05 18:29:32 +00:00
paul
5217b7011b tests: add test to check overload precedence for ShortString type passed to other string types
git-svn-id: trunk@21192 -
2012-05-02 08:45:54 +00:00
paul
548cdece84 tests: add test to check overload precedence for AnsiString type passed to other string types
git-svn-id: trunk@21191 -
2012-05-02 02:52:10 +00:00
paul
50ddd16619 tests: add string constant overload precedence tests when default string type is UnicodeString
git-svn-id: trunk@21190 -
2012-05-02 02:34:12 +00:00
Jonas Maebe
4ac396bd74 * and now the actual test object files...
git-svn-id: trunk@21108 -
2012-04-28 22:28:26 +00:00
Jonas Maebe
562b968b16 * now that copy() expressions are only translated into calls during the
first pass, we have to manually set the varstate of its parameters during
    the typecheck pass (mantis #21878)

git-svn-id: trunk@21106 -
2012-04-28 21:33:29 +00:00
sergei
c08ab0f745 * Re-raising exceptions must be allowed only in 'except' block itself, not in 'try' block of a nested try..except statement. Mantis #21873.
git-svn-id: trunk@21100 -
2012-04-28 15:59:34 +00:00
Jonas Maebe
e20639732f + cghlcpu unit with thlbasecgcpu class that overrides all abstract tcg
methods that don't have to be implemented by targets using the high
    level code generator, with dummy implementations that raise an internal
    error (to remove warnings about instantiating classes with abstract
    methods)
  * let the JVM tcg descendent derive from this new thlbasecgcpu class

git-svn-id: trunk@21098 -
2012-04-28 14:27:31 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00