Commit Graph

552 Commits

Author SHA1 Message Date
Michaël Van Canneyt
4e959de2c7 * Do not insert widechar -> ansichar conversion node in const declaration
* Allow array constructor to contain widechars in mode unicodestring.
2023-07-22 08:26:22 +00:00
Sven/Sarah Barth
0b7a771ca9 * fix #40221: don't allow a conversion from an anonymous function to a procvar type if compare_defs_ext already rejected them
+ added tests
2023-06-16 17:28:50 +02:00
Sergey Larin
de58691e75 Allow WideChar const to UTF8String const conversion 2023-02-24 22:59:39 +00:00
Sven/Sarah Barth
4510945465 * fix #40062: ensure that Self is only added to anonymous functions when dealing with method pointers
+ added test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
d410deb7ae * when assigning an anonymous function to a method pointer move the function to the normal function level to avoid potential problems when accessing other variables 2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
a6ddea87b7 * don't free the old, captured Self symbol as that does not belong to the anonymous function 2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
3c2703787c * ensure that newly created tloadparentfpnodes have a valid resultdef as they might be created in situation where the loadnode itself is no longer typechecked 2022-11-06 22:01:48 +01:00
florian
1c86a4bbeb * if a pointer_to_array type conversion is applied to a variable, it is not written, resolves #39957 2022-10-14 23:12:18 +02:00
Jonas Maebe
a6c7ed5e61 vector support: use vector result types
Set the result of a vector add node to a vector type.

Ensure that that these vector types are still asignment-compatible with
regular array types (may want to change this when we expose vector types),
and don't remove type conversions from vector types to array types (so the
code generator pass can still rely on the resultdef being a vector type)
2022-09-16 11:21:04 +02:00
Jonas Maebe
743d7c50d0 do_set: immediately exit in case of range error
Prevents run time error in case of a compiler compiled with range checks
enabled (webtbf/tw10890a)
2022-05-29 13:33:27 +02:00
Sven/Sarah Barth
7974f39522 * implement assignment of procedure and method variables and routines (global, instance and nested) to function references 2022-05-26 21:44:24 +02:00
Sven/Sarah Barth
76df7144ba * implement necessary conversion functionality for anonymous procdefs to function reference interfaces including capturing of variables 2022-05-26 21:44:23 +02:00
Sven/Sarah Barth
2be8f01efe * implement assignment of anonymous functions to procedure or method variables if they either capture nothing or (in case of method variables) at most the Self variable 2022-05-26 21:43:01 +02:00
Sven/Sarah Barth
2cc621618a * Delphi-mode calling without parenthesis 2022-05-26 21:43:00 +02:00
Sven/Sarah Barth
6e7a82440e * apply patch by Blaise.ru: avoid internal error when assigning class methods, accessed via a class reference type, to incompatible procvars
+ added tests
2022-05-26 21:42:55 +02:00
J. Gareth "Curious Kit" Moreton
54aae023ea * Bug fix that prevents downsizing of
"(x div y) and z" when "x div y" is 64-bit and
    z is 32-bit or less.  Fixes i39646
2022-05-07 20:53:35 +00:00
florian
29a5d3267c * moved warning about suspicious comp assignment to type check pass, catches also
assignments of constants

git-svn-id: trunk@49242 -
2021-04-21 19:51:22 +00:00
florian
71dc62dde6 * if left is a smaller type, then an extension operation for shr can be removed
git-svn-id: trunk@49231 -
2021-04-18 19:19:35 +00:00
florian
09628e56cb * even if currency is handled by torddef, it is a real number, so using / is perfectly right, resolves #38718
git-svn-id: trunk@49154 -
2021-04-09 20:38:46 +00:00
florian
ecce39a3b2 + throw a warning in ISO mode if a constant string is assigned to a char and the sizes do not match, resolves #38439
git-svn-id: trunk@48563 -
2021-02-09 20:48:27 +00:00
florian
344aadebb9 * avoid widening of shl operations, this is not necessary for them either
git-svn-id: trunk@48150 -
2021-01-12 21:45:38 +00:00
florian
9858d9c5e6 * apply doremoveinttypeconvs to unary minus and not on 8 and 16 bit targets as well
git-svn-id: trunk@47796 -
2020-12-16 21:55:05 +00:00
florian
d5dcf5cd7a * cleanup
git-svn-id: trunk@47522 -
2020-11-21 21:58:30 +00:00
florian
ea11517d27 + optimization type converted (modulo) divisions as well by removing up/down converting but,
insert a test and separate code path for -1 if needed

git-svn-id: trunk@47521 -
2020-11-21 21:58:28 +00:00
florian
6380df9b42 * correctly simplify tree transforms of (a+c1+c2) if a is a pointer, resolves #37671
git-svn-id: trunk@47437 -
2020-11-16 21:47:19 +00:00
florian
dc547b1426 + remove type conversions also for unary operations if possible
git-svn-id: trunk@47155 -
2020-10-22 21:25:37 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
Jonas Maebe
9f42931eeb * don't print range check warnings when evaluating inlined explicit typecasts
git-svn-id: trunk@46904 -
2020-09-20 10:29:51 +00:00
svenbarth
2c372071fd * correctly handle static arrays with a lower index <> 0
+ added test

git-svn-id: trunk@46901 -
2020-09-19 21:20:07 +00:00
svenbarth
bf1eae7bd6 * small formatting adjustments for the sake of consistency
git-svn-id: trunk@46892 -
2020-09-18 15:00:17 +00:00
svenbarth
2ff18e48a0 * fix for Mantis #36909: apply patch by Ryan Joseph so that array constructors can be used for static arrays as well.
+ added test

git-svn-id: trunk@46891 -
2020-09-18 15:00:15 +00:00
pierre
57b8f28574 Avoid overflow errors on z80 CPU by changing local variable type from aint to tcgint
git-svn-id: trunk@45816 -
2020-07-21 05:23:36 +00:00
svenbarth
eaa2a2006c * fix for Mantis #37272: also allow the empty set for dynamic array parameters; Delphi probably started to allow that together with array constructors.
+ added tests

git-svn-id: trunk@45706 -
2020-06-27 22:33:31 +00:00
Jonas Maebe
5be84e8079 * replaced custom packed record with tmethod
git-svn-id: trunk@45465 -
2020-05-22 13:11:52 +00:00
florian
b6097a0300 * correctly handle result type of string constant nodes for internally created
nodes

git-svn-id: trunk@45231 -
2020-05-03 12:41:17 +00:00
Jonas Maebe
f5e89ded35 * fix tc_bool_2_int simplification in case pass typecheck runs again, e.g.
after getting a copy of the node during CSE (fixes taddset4 compilation
    with LLVM after r44712)

git-svn-id: trunk@45087 -
2020-04-26 11:36:42 +00:00
svenbarth
60345366f2 * fix for Mantis #35140: apply patch by Ryan Joseph together with some further changes by me to add support for constant parameters in generics
+ added tests

git-svn-id: trunk@45080 -
2020-04-25 22:12:35 +00:00
florian
4d73a9e637 * simplify tc_bool_2_int
git-svn-id: trunk@44712 -
2020-04-12 20:50:39 +00:00
florian
04f3784af5 * better setting of expectloc
git-svn-id: trunk@44619 -
2020-04-06 20:44:31 +00:00
Jonas Maebe
afd0ae44ee * use tprocvardef.getreusableprocaddr also for non-address-only copies of
proc(var)defs

git-svn-id: trunk@44517 -
2020-04-02 21:21:40 +00:00
pierre
9c067709f8 Fix invalid typecast revealed by -CriotR option
git-svn-id: trunk@44108 -
2020-02-03 22:35:25 +00:00
florian
91696d2cf3 - remote accidently committed printnode call
git-svn-id: trunk@44099 -
2020-02-02 19:17:22 +00:00
florian
53d2df07b6 * mark handled currencies correctly, so they are handled properly by simplify
git-svn-id: trunk@44098 -
2020-02-02 18:28:42 +00:00
florian
6a1c09bb43 * simplify type conversions of ordinal constants to currency
git-svn-id: trunk@44055 -
2020-01-28 21:19:05 +00:00
Jonas Maebe
67dbd0cdb3 * support nf_internal to ignore currency conversion adjustments also on
platforms that implement currency using a floating point type

git-svn-id: trunk@43817 -
2019-12-30 15:05:02 +00:00
florian
86d8e79e86 * fix some currency issues, resolves #33963 and #36179
git-svn-id: trunk@43620 -
2019-12-01 20:24:00 +00:00
Jonas Maebe
5800ac6213 * fix conversion from Objective-C class/protocol to tvarrec (store in
vPointer) (mantis #36362)

git-svn-id: trunk@43594 -
2019-11-26 21:24:56 +00:00
svenbarth
0a915e883e * keep track of static symbols that a global function references, as those must now be exported from a dynamic package as well if the function can potentially be inlined
git-svn-id: trunk@43544 -
2019-11-21 21:44:53 +00:00
Jonas Maebe
d23c7980aa * properly perform (or not) range/overflow checking when performing constant
propagation into inlined routines, regardless of the range/overflow
    checking state at the caller site

git-svn-id: trunk@43436 -
2019-11-10 12:00:05 +00:00
Jonas Maebe
ac1e0f96bd * replaced tentryfile.get/putsmall/normalset() with a common tget/putset
that expects an open array of byte, and use it for all sets
   o since all sets need to be typecasted to an array type of the appropriate
     size, we'll get a compilation error in case this needs to be done and
     that also tells us at the same time that the ppu version will need to
     be increased
  * enabled {$packset 1} for the compiler, as this is now safe with the above
    changes

git-svn-id: trunk@43407 -
2019-11-06 21:50:19 +00:00