Commit Graph

164 Commits

Author SHA1 Message Date
marco
338873d7a7 --- Merging r39785 into '.':
U    packages/fcl-stl/src/gset.pp
--- Recording mergeinfo for merge of r39785 into '.':
 U   .
--- Merging r39786 into '.':
A    tests/tbs/tb0651.pp
U    compiler/symdef.pas
--- Recording mergeinfo for merge of r39786 into '.':
 G   .
--- Merging r39787 into '.':
U    compiler/pexpr.pas
A    tests/webtbs/uw34287a.pp
A    tests/webtbs/tw34287.pp
A    tests/webtbs/uw34287b.pp
--- Recording mergeinfo for merge of r39787 into '.':
 G   .
--- Merging r39788 into '.':
U    compiler/nbas.pas
--- Recording mergeinfo for merge of r39788 into '.':
 G   .
--- Merging r39812 into '.':
G    compiler/pexpr.pas
--- Recording mergeinfo for merge of r39812 into '.':
 G   .

# revisions: 39785,39786,39787,39788,39812

git-svn-id: branches/fixes_3_2@39835 -
2018-09-27 13:01:08 +00:00
svenbarth
0ba14c7ad8 * fix memory leak when freeing a temp delete node: also call the inherited destructor so that e.g. tnode.optinfo is freed.
git-svn-id: trunk@39558 -
2018-08-03 20:24:05 +00:00
florian
1497b64804 * the temp. locations created by cse were not properly cleanup up, this patch fixes this
git-svn-id: trunk@38624 -
2018-03-25 15:55:34 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
florian
ec45a92fb5 * more nodedata printing fixes, similiar to r35477
git-svn-id: trunk@35480 -
2017-02-25 15:41:39 +00:00
Jonas Maebe
b5fb9beec9 * fixed printing of nodedata to the screen
git-svn-id: trunk@35477 -
2017-02-24 19:57:36 +00:00
svenbarth
c6bfb0064f * keep track of the sections that are created in the asmlists
git-svn-id: trunk@35408 -
2017-02-10 14:38:53 +00:00
florian
82e6e1eb34 + tempinfo flag ti_no_final_regsync which prevents that the final reg. sync. is emitted
git-svn-id: trunk@34787 -
2016-11-05 23:05:41 +00:00
florian
502e48541c * properly copy flags of tempinfo
+ write flags of tempinfo in ttemprefnode.printnodedata

git-svn-id: trunk@34738 -
2016-10-16 19:53:14 +00:00
Jonas Maebe
179c1ab328 * changed ttemp*node.tempinfo^.flags to a private field, and added setters
and getters for the ttemp*node classes instead
   o this will allow descendants to prevent certain flags from being added
     or removed. E.g. for LLVM, certain temps must never be put in registers
     because it cannot typecast a value in a register from a non-record/array
     type to an array type without forcing it to memory (so if that is done
     on an lvalue, the result will be written to the memory temp instead of
     to the register)

git-svn-id: trunk@34358 -
2016-08-21 14:23:09 +00:00
Jonas Maebe
18580d3069 * when assigning a value to a temp marked as ti_const, do not immediately
release the source location in case it was also a temp. Reason: we
    don't increase reference counts when assigning to a ti_const (they are
    like const parameters), so the original value must stay alive until
    the ti_const temp is freed
   o free the original data in the ttempdelete node for the ti_const temp
   o don't increase reference counts when assigning composite types to
     ti_const temps either

git-svn-id: trunk@34287 -
2016-08-12 13:35:51 +00:00
Jonas Maebe
46166c89cb - removed no longer used and unsafe ttemprefnode.create_offset()
functionality

git-svn-id: trunk@33733 -
2016-05-21 10:28:28 +00:00
svenbarth
4f5fc66298 + new parser-only node class to handle Delphi-mode inline specializations
git-svn-id: trunk@31588 -
2015-09-11 12:58:25 +00:00
sergei
657ac78304 * Improved handling of registers used in assembler blocks. Assembler nodes no longer have lists of used registers attached to them. Instead, each specified register creates an allocation/deallocation pair and an additional tai_regalloc.markused item directly in the asmlist. This way, register lists are no longer limited to integer registers, and parsing no longer depends on paramanager to know which registers are volatile.
If assembler block has no modified register list, it is still handled in pass2, by allocating all volatile registers (not only the integer ones as before).

git-svn-id: trunk@30011 -
2015-02-25 21:53:15 +00:00
florian
7b7aa8d542 * remove statements with only a nothing node when they are the only children of a block
git-svn-id: trunk@29628 -
2015-02-04 21:19:40 +00:00
Jonas Maebe
9e29fd424d * changed the "laststatement" parameter of internalstatements() from "var"
to "out"

git-svn-id: trunk@28228 -
2014-07-18 09:09:16 +00:00
florian
3e4198ea45 * take care of dyn. arrays in cse
git-svn-id: trunk@26740 -
2014-02-08 21:47:46 +00:00
florian
99eadb91b3 * run CheckAndWarn to get proper locations for warnings about uninitialized variables
* several fixes to liveness analysis
* get rid of old version defines
+ tests

git-svn-id: trunk@26159 -
2013-12-01 17:01:51 +00:00
florian
3cb747f4a7 * mark the node which is the entry of the user code with a flag
* check for uninitialized variables at the node which is marked as the start of the user code

git-svn-id: trunk@26014 -
2013-11-10 20:20:27 +00:00
florian
541d67771b * keep managed types in registers if possible. Under certain circumstances (if they don't require init/final code,
e.g. being a const parameter or immutable temp. values), managed types like dyn. arrays, new string types and interfaces can be kept in registers.

git-svn-id: trunk@24953 -
2013-06-23 15:16:30 +00:00
sergei
4e873d0561 + Determine early (before pass 2) whether managed parameters/locals/temps will cause the procedure to reference RTTI labels and, therefore, need GOT.
+ trttinode also sets pi_needs_got flag.

git-svn-id: trunk@24767 -
2013-06-02 13:09:47 +00:00
florian
075abd6220 + support of stackframesize for arm thumb
+ estimatedtempsize to get a good estimatation for architectures which require to know the stack size before

git-svn-id: trunk@24188 -
2013-04-07 21:00:38 +00:00
florian
7155808570 + ttempcreatenode.printnodedata writes tempinitcode node
git-svn-id: trunk@24116 -
2013-04-01 19:52:39 +00:00
Jonas Maebe
b50d0aa3d0 * only don't pre-finalize funcret temps that are passed by reference to the
called function, fixes webtbs/tw3742.pp after r21955 (looked at wrong
    testsuite results :/ )

git-svn-id: trunk@21963 -
2012-07-23 23:55:00 +00:00
florian
c62a2c8bb5 + write temptype when printing tempdelete nodes
git-svn-id: trunk@21752 -
2012-07-01 18:46:13 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
florian
111d05c68f o patch by Alexander Shishkin, resolves #20409
* eliminate warnings in compiler (i386 & i368->x86_64) and minor refactorings
    - comment out unused vars and types
    - comment out unneeded comparisons (Longword <=> 0)
    - suppress some "comparison always true|false" warnings
    - tweak visiblity sections

git-svn-id: trunk@19385 -
2011-10-05 20:11:09 +00:00
Jonas Maebe
cf47b8d422 * fixed all known memory leaks in the code added for the JVM port
git-svn-id: branches/jvmbackend@19248 -
2011-09-26 19:31:34 +00:00
Jonas Maebe
4be0ba267a * moved creating block/statement for reference temps into
maybereplacewithtempref() helper

git-svn-id: branches/jvmbackend@18591 -
2011-08-20 08:13:16 +00:00
Jonas Maebe
a2a6b2fd1d + "reference" temps that sort of implement pointer-style functionality for
platforms that don't support pointers (by make a copy of all registers
    part of a reference)

git-svn-id: branches/jvmbackend@18377 -
2011-08-20 07:54:10 +00:00
Jonas Maebe
cb1da8de85 * fixed getcopy order for ttempcreatenode in case it has tempinitcode
(this tempinitcode contains a reference to the tempcreatenode itself
     -> hookoncopy must be set before copying the tempinitnode)

git-svn-id: trunk@18016 -
2011-07-18 00:38:47 +00:00
florian
ecb04d1620 * use tcgint instead of aint in ttempcreatenode
git-svn-id: trunk@18011 -
2011-07-17 20:10:05 +00:00
florian
2005f6869b * cycling with $R+ fixed
git-svn-id: trunk@17600 -
2011-05-28 21:18:35 +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
24fea58b92 + initial implementation of iso style gotos in iso mode
* made setjmp/longjmp accessible to the compiler by compiler proc, they are used by the iso goto code

git-svn-id: trunk@15711 -
2010-08-05 19:20:46 +00:00
Jonas Maebe
40705a085f * renamed is_refcounted_type() into is_managed_type(), because it also
returns true for variants and those aren't refcounted
  * also allow tempnodes for pointers to managed types to be put in
    registers (not sure why it was disabled, and there are no
    testsuite regressions by enabling it)

git-svn-id: trunk@15319 -
2010-05-22 20:51:50 +00:00
Jonas Maebe
a055ed873d * set correct expectloc for vectorfpu temps
git-svn-id: trunk@15217 -
2010-05-03 15:42:40 +00:00
Jonas Maebe
a48a37d38b * fixed extended syntax checking {$x-} by moving it from the typecheck pass
to the parser, so that it only looks at what the programmer wrote rather
    than at all statements that the compiler may generate internally
    (mantis #11619)
  + several tests for {$x-} mode
  * modified tenumerators1 so it compiles without extended syntax enabled
    (to check for..in with {$x-})

git-svn-id: trunk@15075 -
2010-03-27 12:51:27 +00:00
Jonas Maebe
1f4d7d6057 * add type symbol names to -vp output (patch by Adriaan van Os, mantis
#15737)

git-svn-id: trunk@14903 -
2010-02-13 16:47:37 +00:00
florian
7707e6a030 + tempcreate nodes can now take an init. value, this allows to initilialize temp. ref nodes on the fly
git-svn-id: trunk@14595 -
2010-01-10 13:19:16 +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
yury
491f0fa1d8 * Replaced all user defined warnings by TODO comments to reduce compiler noise.
git-svn-id: trunk@11443 -
2008-07-23 11:00:03 +00:00
Jonas Maebe
ed7511de58 * safeguard the nf_block_with_exit flag when simplifying blockn and
statementn + test

git-svn-id: trunk@9134 -
2007-11-04 18:33:07 +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
peter
4525df9ea0 * nf_is_funcret node flag added
* remove ti_is_funcret, use new node flag instead
  * check for funcret node in doreplace instead of funcretsym

git-svn-id: trunk@8578 -
2007-09-20 20:24:30 +00:00
peter
e0cf015159 * refactor function result handling
* rename methodpointerinit/done to callinitblock/callcleanupblock
  * moved checks in callnode to separate functions
  * funcretnode is now always a simple node instead of a block of
    statements
  * funcret and methodpointer are generated/optimized only in pass_1 so
    a conversion from calln to loadn is much easier
  * function result assignments are much more often optimized to use the
    assignment destination location instead of using a temp

git-svn-id: trunk@8558 -
2007-09-18 22:12:07 +00:00
peter
5f4b89903c * use callnodeflag to check if the result of a function is used
git-svn-id: trunk@8425 -
2007-09-10 16:40:40 +00:00
Jonas Maebe
df84ca49b4 * fixed tests/cg/opt/tretopt, and also in more cases
perform the transformation of x:=f(hiddencomplexresult, ..)
    -> f(x, ...) (the compiler now performs some very
    conservative escape analysis for such types)

git-svn-id: trunk@8361 -
2007-09-02 21:27:37 +00:00
Jonas Maebe
e4487e628d * fixed overload choosing error on 64 bit
git-svn-id: trunk@8327 -
2007-08-29 06:30:38 +00:00