Commit Graph

489 Commits

Author SHA1 Message Date
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
svenbarth
df893b4a30 * implement a type conversion from an array constructor to a dynamic array
git-svn-id: trunk@36095 -
2017-05-04 21:34:38 +00:00
svenbarth
6e31a7ac83 + add an overload to arrayconstructor_to_set that allows it to be used without the passed in node being freed
git-svn-id: trunk@36094 -
2017-05-04 21:30:52 +00:00
svenbarth
cc5e3fdee9 + add utility function arrayconstructor_can_be_set which uses similar code to arrayconstructor_to_set to check whether an array constructor has even a chance to be converted to a set
git-svn-id: trunk@36093 -
2017-05-04 21:28:03 +00:00
nickysn
8033392554 * on 16-bit CPUs remove unnecessary 32-bit conversions of integers, that are
later converted back to 16 bits

git-svn-id: trunk@35679 -
2017-03-29 10:49:32 +00:00
Károly Balogh
5426c11611 marked a few uses of TConstExprInt as const during parameter passing, to avoid a few unnecessary record copying
git-svn-id: trunk@35509 -
2017-03-03 17:29:59 +00:00
Jonas Maebe
a2017b2327 * don't keep tc_equal type conversions for LLVM in case the resultdef doesn't
change, since then we definitely don't have to insert a type conversion at
    the LLVM level either (fixes webtbs/tw1901 for LLVM)

git-svn-id: trunk@35057 -
2016-12-04 11:15:09 +00:00
florian
4862e64b53 * type conversions of constants require that unneeded bits are cut off
git-svn-id: trunk@34797 -
2016-11-05 23:05:58 +00:00
florian
000cffa8e3 * make more use of nf_internal to avoid range check errors
git-svn-id: trunk@34793 -
2016-11-05 23:05:51 +00:00
Jonas Maebe
66be068365 * set the correct resultdef after converting a dynamic array to an open array
in ncnv
  * handle the fact that we overwrite the open array resultdef of a parameters'
    left node with the original resultdef (i.e., also for dynamic arrays) with
    regards to LLVM type rules
   o use the parameter's formal type (open array) instead of the value's type
     (dynamic array) when loading/using its value, since that's the type the
     value has been converted to
   o this change is not really nice since it adds several independent checks in
     different places, but I can't find a way to nicely unify the code to work
     around this (nor one to get rid of that hack in the first place)

git-svn-id: trunk@34515 -
2016-09-11 17:12:04 +00:00
Jonas Maebe
661be0baad * replaced ctemprefnode.create_offset() usage in variant array indexing
operations

git-svn-id: trunk@33731 -
2016-05-21 10:28:22 +00:00
Jonas Maebe
1e1b36515e * don't narrow expressions that contain a mod/div followed by an "and",
since the mod/div get a different result if calculated using fewer
    bits (mantis #29930)

git-svn-id: trunk@33413 -
2016-04-02 22:09:34 +00:00
Jonas Maebe
bbe8e346e0 * handle tc_equal typeconversions from conststring to a stringdef in
simplify, so that shortstring -> shortstring constant string conversions
    are simplified for LLVM too (it leaves regular tc_equal type conversions
    because often the type is still somewhat different), which is required
    for the code in tasmlisttypedconstbuilder.tc_emit_stringdef() (it
    assumes the result of inserting a type conversion is again a
    stringconstant if it can be handled at compile time)

git-svn-id: trunk@32907 -
2016-01-10 14:01:58 +00:00
Jonas Maebe
49a83b2872 * allow targets to keep certain type conversions for equal types in
inserttypeconv()
   o keep typeconversions between structurally equivalent but semantically
     different procvardefs for LLVM and JVM, because they're different
     types there

git-svn-id: trunk@32904 -
2016-01-10 14:01:46 +00:00
Jonas Maebe
ea0c8e6f38 - reverted accidentally committed code with r32463
git-svn-id: trunk@32476 -
2015-11-22 11:52:30 +00:00
Jonas Maebe
688b9c0a69 * use the correctly typecasted reference in a_bit_set_reg_ref
git-svn-id: trunk@32463 -
2015-11-22 11:49:07 +00:00
Jonas Maebe
18ad8fc004 * fixup for r32338: to reset a typeconvn, its convtype must also be set
back to tc_none

git-svn-id: trunk@32342 -
2015-11-15 23:15:46 +00:00
Jonas Maebe
6677747d74 * reprocess changed typeconvn in doremoveinttypeconvs(), as the changed
resultdef can result in a different type conversion (e.g. from nothing
    to int_2_int in case the result size changes)

git-svn-id: trunk@32338 -
2015-11-15 19:57:04 +00:00
yury
9431648b6c * Fixed conversion from float to currency when the currency type is 64-bit integer. Issue #28748.
git-svn-id: trunk@32054 -
2015-10-13 22:30:46 +00:00
Jonas Maebe
b22e2ef400 * add "doregister" parameter to tsetdef.create, and don't register temporary
defs created in the scanner for evaluating compile time expressions

git-svn-id: trunk@32048 -
2015-10-13 15:59:12 +00:00
svenbarth
529677cc79 ncal.pas:
* extend tcallnode with the ability to pass a tspecializationcontext so that tcallcandidates can do a final specialization
  * the final procdef is registered at the end of tcallnode.pass_typecheck

git-svn-id: trunk@31763 -
2015-09-18 14:48:54 +00:00
yury
432248cbf1 * Removed lot of unused vars.
git-svn-id: trunk@31732 -
2015-09-17 12:48:58 +00:00
Jonas Maebe
fbacf9682f * rename WinCE softfp compilerproc names to lowercase, needed since r31404
(mantis #28598)

git-svn-id: trunk@31478 -
2015-09-02 09:54:02 +00:00
Jonas Maebe
fa1ac2515e * don't look for overloaded operators in case of internally generated
type conversions (mantis #28375)

git-svn-id: trunk@31191 -
2015-07-03 20:19:48 +00:00
florian
01cbf00455 * unified code to remove unnecessary type casts to support also removals of type conversions between smaller ints
* get rid of unnecessary 8->16 Bit type conversions on 8 Bit CPUs, resolves issue #27839

git-svn-id: trunk@30726 -
2015-04-25 21:18:34 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00