Commit Graph

514 Commits

Author SHA1 Message Date
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
florian
e19eff1332 * also type casts to booleans benefit if unneeded type widenings are removed
git-svn-id: trunk@43344 -
2019-11-01 09:52:37 +00:00
svenbarth
663040a666 * ensure that aprocdef is initialized to Nil to catch problems with compare_defs_ext() easier
git-svn-id: trunk@42699 -
2019-08-15 14:32:57 +00:00
Jonas Maebe
c038e4c3f2 * relaxation of r42272: again only show warnings rather than errors for
out-of-range constants, because of the comments mentioned in #35753
    (except for enums, as apparently Delphi does the same)
  * added range check warnings about explicit type casts that throw away
    bits (e.g. byte($fff)), without giving warnings for most common cases
    (like cardinal(-1))
  * fixed masking/sign exting constant array indices (must be based on index
    range type size/signedness rather than on array size/"signedness")

git-svn-id: trunk@42275 -
2019-06-23 14:12:33 +00:00
pierre
243c967967 Commit of new debug feature implemented by J. Gareth Moreton
Allows compilation of compiler using -dDEBUG_NODE_XML
  which will generate a NAME-node-dump.xml file for each 
  unit, program or library compiled,
  containing a XML description of the nodes handled during
  compilation of the unit, program or library.

git-svn-id: trunk@42271 -
2019-06-22 14:08:47 +00:00
florian
749c4d4e47 + keep (certain) arrays in registers if they are used with constants indices only
git-svn-id: trunk@42239 -
2019-06-16 21:29:48 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
svenbarth
18519c9559 * fix for Mantis #34526: rely on tc_arrayconstructor_2_set instead of manually converting an array constructor to a set, this way assignment operator overloads are taken into account as well
Note: there is still a conversion to a set if the types were determined to be incompatible, so that the error is still "set of X is incompatible to Y" instead of "array of Z is incompatible to Y"
+ added tests

git-svn-id: trunk@41844 -
2019-04-05 15:24:39 +00:00
svenbarth
156b25501d * improve conversion of array constructor to set so that it behaves as if done inside pass_typecheck
git-svn-id: trunk@41843 -
2019-04-05 15:24:36 +00:00
yury
e5c2d13671 * Do not set pi_needs_got in current_procinfo.flags at the node level, since the GOT usage can only be estimated there. Instead set the pi_needs_got flag at places where the GOT register is accessed during the code generation. This eliminates generation of the unneeded initialization of the GOT register and fixes linker errors when the _GLOBAL_OFFSET_TABLE_ symbol is referenced but no actual GOT references are present.
git-svn-id: trunk@41460 -
2019-02-25 13:35:40 +00:00
Jonas Maebe
acf02ab64b * when creating wrappers, add a prefix to parameter names to prevent them
hiding the method name of the wrapped routine
   o also add a few more '&' prefixes to the generated wrapper code to
     prevent issues when keywords are used as identifiers

git-svn-id: trunk@40634 -
2018-12-24 22:10:06 +00:00
Jonas Maebe
dd29088430 * simplify all type conversions for formal constants even for LLVM and JVM
(since these happen at compile time and don't result in generated code,
     they never need extra type conversions in the code)

git-svn-id: trunk@40629 -
2018-12-24 22:09:48 +00:00
Jonas Maebe
2c7c0d1144 * handle widechar constants directly in the scanner, instead of in the
overload selection (where you can't even know whether the string is
    a valid widechar constant) (mantis #33875)

git-svn-id: trunk@40009 -
2018-10-21 17:34:00 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
florian
68eb921d46 * broken compilation after r39347 fixed
git-svn-id: trunk@39349 -
2018-06-30 12:30:25 +00:00
Jonas Maebe
8da8b956b0 * discard type conversions from/to generic defs for llvm as well
git-svn-id: trunk@38864 -
2018-04-28 16:17:45 +00:00
Jonas Maebe
eaafb166ad * set totypedef correctly when converting @class.classmethod to a procvar
of object in FPC mode (for llvm)

git-svn-id: trunk@38863 -
2018-04-28 16:17:41 +00:00
Jonas Maebe
1f9d518c57 * support for non-ASCII widechar constants (mantis #31605)
* also improved type checking for converting constant strings to integers
    in MacPas mode

git-svn-id: trunk@38730 -
2018-04-10 19:24:15 +00:00
nickysn
6929af07b7 + added flag tcnf_proc_2_procvar_get_offset_only
git-svn-id: trunk@38680 -
2018-04-04 14:48:12 +00:00
nickysn
99a1cf89b3 + print convnodeflags in printnodeinfo
git-svn-id: trunk@38679 -
2018-04-04 13:20:41 +00:00
nickysn
3318703ece * moved nf_typedaddr to addrnodeflags (anf_typedaddr)
git-svn-id: trunk@38671 -
2018-04-03 16:41:01 +00:00
nickysn
c9aecb8e94 * also compare convnodeflags in ttypeconvnode.docompare
git-svn-id: trunk@38669 -
2018-04-03 15:03:40 +00:00
nickysn
da609779d2 * simplify ttypeconvnode.printnodeinfo by making use of the fact that
write/writeln now can print enums

git-svn-id: trunk@38668 -
2018-04-03 14:49:31 +00:00
Jonas Maebe
4da6039f40 * simplify empty-dynamic-string-to-pointer (non-p(wide)char) type conversions
so that they cannot result in "cmp const, const" at the assembler level
    (mantis #33548)

git-svn-id: trunk@38662 -
2018-04-02 18:35:00 +00:00
nickysn
c665866517 + introduce the tcnf_proc_2_procvar_2_voidpointer flag (for now it is only set,
but not used)

git-svn-id: trunk@38638 -
2018-03-27 16:15:06 +00:00
nickysn
3e9b9451b4 * copy the new convnodeflags field in ttypeconvnode.dogetcopy
git-svn-id: trunk@38637 -
2018-03-27 15:58:53 +00:00
nickysn
6ad786f8ef + introduce ttypeconvnodeflags (empty for now)
git-svn-id: trunk@38636 -
2018-03-27 15:33:50 +00:00
florian
61053ead34 + optimize is operator if used on sealed classes as proposed in #30097
git-svn-id: trunk@38387 -
2018-02-28 22:09:24 +00:00
florian
e523865b07 * do not take the size of an open array, resolves #33230
git-svn-id: trunk@38366 -
2018-02-27 21:08:07 +00:00
florian
d031545f88 * warn if the first constant element of a range set expression is greater than the second one, resolves #31936
git-svn-id: trunk@38321 -
2018-02-23 22:30:35 +00:00
Jonas Maebe
0f0bdabb89 * if an absolute typeconversion changes the size, make the source not
regable. Normally this is done when the absolute typeconversion node
    gets created, but the size can sometimes still change afterwards (e.g.
    when removing superfluous 64 bit type conversions) (mantis #32160)

git-svn-id: trunk@37930 -
2018-01-07 15:37:23 +00:00
Jonas Maebe
2919d97f91 * support asssigning @class.classmethod to a procvar of object in FPC modes
(mantis #14103)

git-svn-id: trunk@37925 -
2018-01-06 17:47:44 +00:00
Jonas Maebe
dcac6b9c6f * disallow passing a dynarray(niln/pointerconstn) as an open array
(mantis #31273)

git-svn-id: trunk@37885 -
2017-12-31 15:18:40 +00:00
florian
f22a6629c1 * set types correctly for char -> shortstring conversions, resolves #32686
git-svn-id: trunk@37585 -
2017-11-12 22:14:23 +00:00
svenbarth
0351369698 * ttypeconvnode.typecheck_arrayconstructor_to_dynarray: the assignment node of the temp array to the resulting array always needs to exist, so remove the assigned() check
git-svn-id: trunk@36245 -
2017-05-18 20:07:57 +00:00
svenbarth
b78037f6f2 * ttypeconvnode.typecheck_arrayconstructor_to_dynarray: use ctempcreatenode.create_value() instead of create() to get rid of the explicit addition of an assignment node
git-svn-id: trunk@36244 -
2017-05-18 20:07:02 +00:00
nickysn
460dd1c10a * remove the redundant equal typeconv, left over as an artifact after removing
the unnecessary widening of intermediary calculations to 64-bit. This allows,
  among other things, the x:=x+k optimization to be applied in the case of
  signed32:=signed32+unsigned32 types.

git-svn-id: trunk@36191 -
2017-05-12 11:40:06 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
florian
c7ba611bf9 * when explicitly casting a variable, it might be sufficient if it is const_regable
git-svn-id: trunk@36137 -
2017-05-06 18:47:45 +00:00