Commit Graph

121 Commits

Author SHA1 Message Date
Jonas Maebe
3ac703506c * rest of the previous accidental partial commit
git-svn-id: branches/fixes_3_2@41250 -
2019-02-07 19:56:21 +00:00
svenbarth
9b45f58c0b + add flags that allow checking for overloads with isbinaryoverloaded() and isunaryoverloaded() without modifying the passed in node or even checking for normally non-overloadable operators
git-svn-id: trunk@39258 -
2018-06-20 19:53:34 +00:00
svenbarth
afbbd22544 - the labtree argument is no longer needed
git-svn-id: trunk@38861 -
2018-04-27 21:09:09 +00:00
svenbarth
cfa373a8cf * fix case of string with ranges as labels
+ add test

git-svn-id: trunk@38860 -
2018-04-27 21:06:33 +00:00
svenbarth
d50848174a + add putboolean and getboolean convenience methods to tentfile
* use putboolean and getboolean where approbiate

git-svn-id: trunk@37972 -
2018-01-14 21:36:02 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
florian
d5754cf47c * create jmp trees for really big case statements
git-svn-id: trunk@35645 -
2017-03-23 17:50:53 +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
florian
5df9b994d1 * fix warnings which were caused by last changes to for node generation
git-svn-id: trunk@34789 -
2016-11-05 23:05:44 +00:00
Jonas Maebe
3669419bb3 * fixed tcasenode.simplify() in case we have to pass via a "less" branch of
of a tcaselabel that also has a valid "greater" branch to arrive at the
    correct entry (mantis #30522)

git-svn-id: trunk@34379 -
2016-08-26 13:02:10 +00:00
Jonas Maebe
ee87d3bba9 * fixed "case <string> of" with multiple labels for a single statement after
r30855 (mantis #28372)

git-svn-id: trunk@31190 -
2015-07-03 20:04:25 +00:00
Jonas Maebe
ac592ed634 - removed some more unnecessary code after r30855
git-svn-id: trunk@30857 -
2015-05-14 17:44:37 +00:00
Jonas Maebe
801fc50e86 * simplified "case stringexpr of" handling and removed memory leaks due to
symbols that weren't put in any symbol table (and that couldn't be put
    anywhere, since they all had the same name)

git-svn-id: trunk@30855 -
2015-05-14 14:42:38 +00:00
Jonas Maebe
b57c95043f + support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual
   o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
     class
   o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
     class from the base classes, and initialises the c*def/c*sym classes with
     them. This is done so that the llvm target will be able to derive from
     the tcpu*def/sym classes without umpteen ifdefs, and it also means that
     the WPO can devirtualise everything because the c* variables are only
     initialised with one class type
   o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
     calls

git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
svenbarth
60a07770f1 Fix cycling after addition of the new case simplification.
nset.pas, tcasenode.simplify: don't assume a specific order of the case labels

+ added test based on ppu.pas, tppu.getaint where no matching case label was found because of the ordering

git-svn-id: trunk@26825 -
2014-02-21 22:49:19 +00:00
svenbarth
500920030b Implement simplification of ordinal case nodes if the case expression is constant (might be useful when inlining).
+ nset.pas, tcasenode: add simplify method; for ordinal constant case expressions either return a copy of the correct block or return a nothing node if the constant did not match anything

+ added test to check that nothing is broken

git-svn-id: trunk@26824 -
2014-02-21 20:36:41 +00:00
florian
fbcfb63826 + implement tcasenode.pass_typecheck
git-svn-id: trunk@26644 -
2014-02-01 13:08:26 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
paul
5d74e0578a compiler: remove unused variables and unneeded assignments
git-svn-id: trunk@23467 -
2013-01-21 01:24:36 +00:00
florian
247d6dd394 + implemented a tcasenode.printnodetree printing all cases
git-svn-id: trunk@23414 -
2013-01-16 20:24:56 +00:00
Jonas Maebe
3983342648 * free temps created for case-of-string-statements
git-svn-id: trunk@22100 -
2012-08-16 19:22:23 +00:00
florian
d35d1ed357 + initial support for pascal booleans with sizes 2, 4 and 8
git-svn-id: branches/pasboolxx@17836 -
2011-06-26 15:02:37 +00:00
paul
d21bbc4548 compiler: reduce amount of hints and warnings
git-svn-id: trunk@17350 -
2011-04-20 02:58:52 +00:00
florian
6fb666135f * forbid <ordinal> in <set type>
git-svn-id: trunk@17263 -
2011-04-06 20:32:45 +00:00
pierre
f49fb7329a * Avoid crash if right node of _IN keyword is a type node that is not a set
git-svn-id: trunk@17159 -
2011-03-21 07:57:37 +00:00
paul
4531e1231b compiler: implement Inc, Dec class operators
- extend tok2node array to store inline function number for the case when nodetype = inlinen, add Inc, Dec operators to array
 - implement inline function support in isunaryoverloaded
 - check for operator overload if Inc, Dec is not used for standard types
 - extend test to check Inc,Dec operators

git-svn-id: trunk@16629 -
2010-12-24 09:26:52 +00:00
paul
d97cf8ed9d compiler: implement IN operator which was known by compiler but was not supported. + test
git-svn-id: trunk@16622 -
2010-12-24 02:25:22 +00:00
Jonas Maebe
769eb3f604 * moved the initialisation of the nodetree and tai class reference constants
from the unit initialisation sections to the variable declaration sections
    to prevent the base units from overriding derived classes (based on patch
    by Hans-Peter Dietrich, mantis #17516)

git-svn-id: trunk@16118 -
2010-10-09 18:52:22 +00:00
Jonas Maebe
94d976bc87 * when simplifying ordinal expressions during inlining, keep the resultdef
that was set during the typecheck pass because typeconversion nodes
    may have been optimised away previously and sometimes the resultdef is
    important (e.g. for the value of callparanodes) (mantis #17458)

git-svn-id: trunk@16101 -
2010-10-07 15:08:52 +00:00
florian
f3c572edc5 * handle multiple string labels in one case branch correctly, resolves #16130
git-svn-id: trunk@15212 -
2010-05-02 21:44:24 +00:00
paul
1b614b526a compiler:
- add own symbol table for enumeration to store enumeration elements
  - reimplement enumeration member traverse using symbol table instead of firstenum/nextenum - that members are removed
  - implement TEnum.Element access syntax - element is searched in the enumeration symtable in this case instead of global/local symtables
  - implement {$SCOPEDENUM ON/OFF} local switch
  + tests

git-svn-id: trunk@15051 -
2010-03-25 05:46:53 +00:00
florian
448f3d99c1 * cleanup of case <string> of code by Sergei Gorelkin, resolves #13700
git-svn-id: trunk@14467 -
2009-12-23 19:27:50 +00:00
florian
44aed2af60 o patch by Michael Denisenko, resolves #14734:
* fixes memory leaks in case of string code
  * replace usage of strcmp
  * improved tests

git-svn-id: trunk@13830 -
2009-10-09 20:40:22 +00:00
florian
cf215d5097 o patch by Michael V. Denisenko to handle case <string> of (see also #13700)
+ compiler implementation
  + tests

git-svn-id: trunk@13642 -
2009-09-03 20:21:30 +00:00
peter
060bdbcb47 * fix writing of goto node to ppu
* replace derefnode with resolveppuidx method that only needs to be
    implemented for nodes referencing other nodes
  * fix IE when a label is not defined in inline function

git-svn-id: trunk@11697 -
2008-09-03 20:46:04 +00:00
florian
8fe43377e1 + convert case <boolean> of into if statement, resolves #10517
git-svn-id: trunk@10873 -
2008-05-03 10:27:55 +00:00
peter
417c832e9d * in node simplify
git-svn-id: trunk@10310 -
2008-02-12 17:27:27 +00:00
peter
74f21d7bc3 * typecheck after converting type to constant set
git-svn-id: trunk@10081 -
2008-01-28 17:35:32 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
peter
6058b2c247 * renamed t_times to executionweight and moved it to
code generation pass
  * include executionweight in the spilling decision

git-svn-id: trunk@9330 -
2007-11-25 16:38:05 +00:00
Jonas Maebe
82cf80d4ca * added missing tcasenode.derefnode override to process all the
case-blocks and the else-block

git-svn-id: trunk@9251 -
2007-11-14 19:40:28 +00:00
peter
6b8aed593f * remove registers{int/mmx/fpu} from firstpass
* small cleanups of unused variables in firstpass
  * node_resources_fpu() created to get an approximation of the
    required fpu registers
  * for the moment use node_complexity in the CG until the
    node_resource_int() is created

git-svn-id: trunk@8655 -
2007-09-26 21:12:01 +00:00
Jonas Maebe
89ed91509a * Some fixes for r8515:
* fixed set add-nodes in case left and right are swapped (taddset4)
   * fixed "in" expressions with packed sets in case left is < setbase
     (now tested by tw8258b, which was missing a {$packset 1} directive)

git-svn-id: trunk@8519 -
2007-09-16 22:24:42 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00
Jonas Maebe
2e3833cd7a * slightly improved previous in checking patch
git-svn-id: trunk@6892 -
2007-03-16 22:31:51 +00:00
Jonas Maebe
428306051f * give again an error for "in" operations on incompatible set
elements/sets after introduction of support for "longint in set"

git-svn-id: trunk@6885 -
2007-03-16 19:44:43 +00:00
Jonas Maebe
f63b0ef160 * fixed overflow for constant in-expressions involving values >
high(uinttype) on the left side

git-svn-id: trunk@6852 -
2007-03-14 19:42:01 +00:00
Jonas Maebe
530d5c125d * limit the left hand side of "in" expressions to 2^32 for now
(fixes webtbs/tw8258 for 64 bit platforms)

git-svn-id: trunk@6393 -
2007-02-10 16:20:47 +00:00
Jonas Maebe
fc3852e59a * in non-TP modes, 'ord_larger_than_256 in set' now always returns
false instead of triggering a range error (mantis #8258,
    based on patch provided by Thorsten Engler)

git-svn-id: trunk@6357 -
2007-02-07 18:57:19 +00:00
Jonas Maebe
e4e6f8112d * fixed some warnings about hidden constructors
git-svn-id: trunk@5784 -
2007-01-02 14:18:12 +00:00