Commit Graph

429 Commits

Author SHA1 Message Date
paul
e784ec1079 merge revisions 13898-13899:
- compiler: allow message after the *deprecated* keyword
 - compiler: raise an internal error if deprecated message is trying to set to a non clear string pointer

git-svn-id: trunk@13997 -
2009-11-01 14:06:30 +00:00
Jonas Maebe
acdb0bbb3e * don't change current_filepos in pass_typecheck when not generating
errornodes (so the that the parser won't afterwards suddenly start
    creating nodes with this different fileinfo)

git-svn-id: trunk@13577 -
2009-08-22 20:21:56 +00:00
florian
c0d4efed2e * forbid passing derived classes to call by reference parent classes (for objects, this is still allowed), resolves #13135
git-svn-id: trunk@13551 -
2009-08-17 21:46:25 +00:00
Jonas Maebe
754696d1f5 * enable converting procedure callnodes with only default parameters into
procvars in tp/delphi mode (mantis #11771)

git-svn-id: trunk@13400 -
2009-07-17 10:29:56 +00:00
Jonas Maebe
1f6ec379de * moved field definitions before method/property definitions (see mantis
#13971)

git-svn-id: trunk@13330 -
2009-06-27 11:27:31 +00:00
Jonas Maebe
e42842b31c * don't allow skipping property parameters if the getter/setter has default
parameters (mantis #13956)
  * when reporting an error about too few specified parameters to a call,
    return the column of the call itself rather than after the last parameter
    (because this ends up after the end of an indexed property in case of
     properties, which is confusing)

git-svn-id: trunk@13326 -
2009-06-26 17:31:41 +00:00
Jonas Maebe
c0e51f3e97 * use reference-counted temps for the method pointer when the method
pointer is of a reference-counted type (reverts r2165, fixes mantis #14019)
  * modified test for mantis #4086 (which was "fixed" by r2165) so it still
    works and no longer depends on whether or not the compiler uses a
    refcounted temp to evaluate certain expressions

git-svn-id: trunk@13310 -
2009-06-21 12:17:51 +00:00
Jonas Maebe
d3cec25dce * small indentation fix
git-svn-id: trunk@13150 -
2009-05-16 10:31:35 +00:00
Jonas Maebe
630aa5c493 * do not use voidtype for temporary parameter/result locations when
inlining, because that results in alignment settings of "0"
    (voidtype.savesize = 0 -> size2align(0) = 0), which is interpreted
    by the code generators as unaligned (and is actually even invalid
    nowadays). This caused errors on NDS when writing to memory mapped
    I/O devices (mantis #13343)

git-svn-id: trunk@12916 -
2009-03-18 22:25:06 +00:00
Jonas Maebe
da461c5154 * fixed calling static class methods from inside other static class methods
git-svn-id: trunk@12866 -
2009-03-08 12:38:02 +00:00
Jonas Maebe
5474004dcc * fixed calling inherited class methods from a regular method (mantis
#11825)

git-svn-id: trunk@12810 -
2009-02-27 17:05:41 +00:00
Jonas Maebe
7d459cf12a * the compiler now explicitly keeps track of the minimally guaranteed
alignment for each memory reference (mantis #12137, and
    test/packages/fcl-registry/tregistry1.pp on sparc). This also
    enables better code generation for packed records in many cases.
  o several changes were made to the compiler to minimise the chances
    of accidentally forgetting to set the alignment of memory references
    in the future:
    - reference_reset*() now has an extra alignment parameter
    - location_reset() can now only be used for non LOC_(C)REFERENCE,
      use location_reset_ref() for those (split the tloc enum so the
      compiler can catch errors using range checking)

git-svn-id: trunk@12719 -
2009-02-08 13:00:24 +00:00
Jonas Maebe
060d81b8fa Merged revisions 11878,11881-11882,11889,11891-11893,11895,11899-11902,11935,11938,12212,12304,12308-12310,12316,12330-12332,12334,12339-12340 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/branches/wpo

........
r11878 | jonas | 2008-10-11 02:25:18 +0200 (Sat, 11 Oct 2008) | 19 lines

  + initial implementation of whole-program optimisation framework
  + implementation of whole-program devirtualisation
  o use:
     a) generate whole-program optimisation information (no need
        to completely compile the program and all of its units
        with -OW/-FW, only the main program is sufficient)
      fpc -OWdevirtcalls -FWmyprog.wpo myprog
     b) use it to optimise the program
      fpc -B -Owdevirtcalls -Fwmyprog.wpo myprog
     (the -B is not required, but only sources recompiled during
      the second pass will actually be optimised -- if you want,
      you can even rebuild the rtl devirtualised for a particular 
      program; and these options can obviously also be used         
      together with regular optimisation switches)
  o warning:
    - there are no checks yet to ensure that you do not use 
      units optimised for a particular program with another
      program (or with a changed version of the same program)

........
r11881 | jonas | 2008-10-11 19:35:52 +0200 (Sat, 11 Oct 2008) | 13 lines

  * extracted code to detect constructed class/object types from
    tcallnode.gen_vmt_tree into its own method to avoid clutter
  * detect x.classtype.create constructs (with classtype = the
    system.tobject.classtype method), and treat them as if a
    "class of x" has been instantiated rather than a
    "class of tobject". this required storing the instantiated
    classrefs in their own array though, because at such a
    point we don't have a "class of x" tdef available (so
    now "x", and all other defs instantiated via a classref,
    are now stored as tobjectdefs in a separate array)
  + support for devirtualising class methods (including
    constructors)

........
r11882 | jonas | 2008-10-11 20:44:02 +0200 (Sat, 11 Oct 2008) | 7 lines

  + -Owoptvmts whole program optimisation which replaces vmt entries
    with method names of child classes in case the current class'
    method can never be called (e.g., because this class is never
    instantiated). As a result, such methods can then be removed
    by dead code removal/smart linking (not much effect for either
    the compiler, lazarus or a trivial lazarus app though).

........
r11889 | jonas | 2008-10-12 14:29:54 +0200 (Sun, 12 Oct 2008) | 2 lines

  * some comment fixes

........
r11891 | jonas | 2008-10-12 18:49:13 +0200 (Sun, 12 Oct 2008) | 4 lines

  * fixed twpofilereader.getnextnoncommentline() when reusing a previously
    read line
  * fixed skipping of unnecessary wpo feedback file sections

........
r11892 | jonas | 2008-10-12 23:42:43 +0200 (Sun, 12 Oct 2008) | 31 lines

  + symbol liveness wpo information extracted from smartlinked programs
    (-OW/-Owsymbolliveness)
  + use symbol liveness information to improve devirtualisation (don't
    consider classes created in code that has been dead code stripped).
    This requires at least two passes of using wpo (first uses dead code
    info to locate classes that are constructed only in dead code,
    second pass uses this info to potentially further devirtualise).
    I.e.:
     1) generate initial liveness and devirtualisation feedback
       fpc -FWtt.wpo -OWall tt.pp -Xs- -CX -XX
     2) use previously generated feedback, and regenerate new feedback
        based on this (i.e., disregard classes created in dead code)
       fpc -FWtt-1.wpo -OWall -Fwtt.wo -Owall tt.pp -Xs- -CX -XX
     3) use the newly generated feedback (in theory, it is possible
        that even more opportunities pop up afterwards; you can
        continue until the program does not get smaller anymore)
       fpc -Fwtt-1.wpo -Owall tt.pp -CX -XX
  * changed all message() to cgmessage() calls so the set codegenerror
  * changed static fsectionhandlers field to a regular field called
    fwpocomponents
  * changed registration of wpocomponents: no longer happens in the
    initialization section of their unit, but in the InitWpo routine
    (which has been moved from the woinfo to the wpo unit). This way
    you can register different classes based on the target/parameters.
  + added static method to twpocomponentbase for checking whether
    the command line parameters don't conflict with the requested
    optimisations (e.g. generating liveness info requires that
    smartlinking is turned on)
  + added static method to twpocomponentbase to request the
    section name

........
r11893 | jonas | 2008-10-12 23:53:57 +0200 (Sun, 12 Oct 2008) | 3 lines

  * fixed comment error (twpodeadcodeinfo keeps a list of live,
    not dead symbols)

........
r11895 | jonas | 2008-10-13 00:13:59 +0200 (Mon, 13 Oct 2008) | 2 lines

  + documented -OW<x>, -Ow<x>, -FW<x> and -Fw<x> wpo parameters

........
r11899 | jonas | 2008-10-14 22:14:56 +0200 (Tue, 14 Oct 2008) | 2 lines

  * replaced hardcoded string with objdumpsearchstr constant

........
r11900 | jonas | 2008-10-14 22:15:25 +0200 (Tue, 14 Oct 2008) | 2 lines

  * reset wpofeedbackinput and wpofeedbackoutput in wpodone

........
r11901 | jonas | 2008-10-14 22:16:07 +0200 (Tue, 14 Oct 2008) | 2 lines

  * various additional comments and comment fixes

........
r11902 | jonas | 2008-10-15 18:09:42 +0200 (Wed, 15 Oct 2008) | 5 lines

  * store vmt procdefs in the ppu files so we don't have to use a hack to
    regenerate them for whole-program optimisation
  * fixed crash when performing devirtualisation optimisation on programs
    that do not construct any classes/objects with optimisable vmts

........
r11935 | jonas | 2008-10-19 12:24:26 +0200 (Sun, 19 Oct 2008) | 4 lines

  * set the vmt entries of non-class virtual methods of not instantiated
    objects/classes to FPC_ABSTRACTERROR so the code they refer to can
    be thrown away if it is not referred to in any other way either

........
r11938 | jonas | 2008-10-19 20:55:02 +0200 (Sun, 19 Oct 2008) | 7 lines

  * record all classrefdefs/objdefs for which a loadvmtaddrnode is generated,
    and instead of marking all classes that derive from instantiated
    classrefdefs as instantiated, only mark those classes from the above
    collection that derive from instantiated classrefdefs as
    instantiated (since to instantiate a class, you have to load its vmt
    somehow -- this may be broken by using assembler code though)

........
r12212 | jonas | 2008-11-23 12:26:34 +0100 (Sun, 23 Nov 2008) | 3 lines

  * fixed to work with the new vmtentries that are always available and
    removed previously added code to save/load vmtentries to ppu files

........
r12304 | jonas | 2008-12-05 22:23:30 +0100 (Fri, 05 Dec 2008) | 4 lines

  * check whether the correct wpo feedback file is used in the current
    compilation when using units that were compiled using wpo information
    during a previous compilation run

........
r12308 | jonas | 2008-12-06 18:03:39 +0100 (Sat, 06 Dec 2008) | 2 lines

  * abort compilation if an error occurred during wpo initialisation

........
r12309 | jonas | 2008-12-06 18:04:28 +0100 (Sat, 06 Dec 2008) | 3 lines

  * give an error message instead of crashing with an io exception if the
    compiler is unable to create the wpo feedback file specified using -FW

........
r12310 | jonas | 2008-12-06 18:12:43 +0100 (Sat, 06 Dec 2008) | 3 lines

  * don't let the used wpo feedback file influence the interface crc (there's
    a separate check for such changes)

........
r12316 | jonas | 2008-12-08 19:08:25 +0100 (Mon, 08 Dec 2008) | 3 lines

  * document the format of the sections of the wpo feedback file inside the
    feedback file itself

........
r12330 | jonas | 2008-12-10 22:26:47 +0100 (Wed, 10 Dec 2008) | 2 lines

  * use sysutils instead of dos to avoid command line length limits

........
r12331 | jonas | 2008-12-10 22:31:11 +0100 (Wed, 10 Dec 2008) | 3 lines

  + support for testing whole program optimisation tests (multiple
    compilations using successively generated feedback files)

........
r12332 | jonas | 2008-12-10 22:31:40 +0100 (Wed, 10 Dec 2008) | 2 lines

  + whole program optimisation tests

........
r12334 | jonas | 2008-12-10 22:38:07 +0100 (Wed, 10 Dec 2008) | 2 lines

  - removed unused local variable

........
r12339 | jonas | 2008-12-11 18:06:36 +0100 (Thu, 11 Dec 2008) | 2 lines

  + comments for newly added fields to tobjectdef for devirtualisation

........
r12340 | jonas | 2008-12-11 18:10:01 +0100 (Thu, 11 Dec 2008) | 2 lines

  * increase ppu version (was no longer different from trunk due to merging)

........

git-svn-id: trunk@12341 -
2008-12-11 17:40:18 +00:00
peter
9086a2549d * refactor overload collection in tcallcandidates. separate
the collecting of overloads. The actual building of
    candidate list is now common

git-svn-id: trunk@12064 -
2008-11-12 22:38:38 +00:00
peter
af437d5beb * refactor the forward type declaration handling, remove
global typecanbeforward and move 'class of ..' parsing
    to ptype

git-svn-id: trunk@12045 -
2008-11-09 22:07:36 +00:00
Jonas Maebe
1e178d324f * explicitly check whether the methodpointer isn't the same as the result
before optimising function result assignment, because at this point the
    hidden self parameter is not yet inserted (mantis #12597)
  * changed ttypeconvnode.actualtargetnode to use the same logic as what
    is used to determine whether something can be assigned to the result
    of a type conversion (so the above check also works if the methodpointer
    contains a typecast to a different object type)

git-svn-id: trunk@12038 -
2008-11-09 10:19:29 +00:00
florian
b178b08ba7 Merged revisions 11665-11738 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/unicodestring

........
  r11665 | florian | 2008-08-30 13:30:17 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * continued to work on unicodestring type support
........
  r11666 | florian | 2008-08-30 19:02:26 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * expectloc for wide/ansi/unicode strings is LOC_CONSTANT or LOC_REGISTER now
........
  r11667 | florian | 2008-08-30 20:42:37 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * more unicodestring stuff fixed, test results on win32 are already good
........
  r11670 | florian | 2008-08-30 23:21:48 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * first fixes for unix bootstrapping
........
  r11683 | ivost | 2008-09-01 12:46:39 +0200 (Mon, 01 Sep 2008) | 2 lines
  
      * fixed 64bit bug in iconvenc.pas
........
  r11689 | florian | 2008-09-01 23:12:34 +0200 (Mon, 01 Sep 2008) | 1 line
  
  * fixed several errors when building on unix
........
  r11694 | florian | 2008-09-03 20:32:43 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * fixed unix compilation
........
  r11695 | florian | 2008-09-03 21:01:04 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * bootstrapping fix
........
  r11696 | florian | 2008-09-03 21:07:18 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * more bootstrapping fixed
........
  r11698 | florian | 2008-09-03 22:47:54 +0200 (Wed, 03 Sep 2008) | 1 line
  
  + two missing compiler procs exported
........
  r11701 | florian | 2008-09-04 16:42:34 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + lazarus project for the linux rtl
........
  r11702 | florian | 2008-09-04 16:43:27 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + set unicode string procedures
........
  r11707 | florian | 2008-09-04 23:23:02 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  * fixed several type casting stuff
........
  r11712 | florian | 2008-09-05 22:46:03 +0200 (Fri, 05 Sep 2008) | 1 line
  
  * fixed unicodestring compilation on windows after recent unix changes
........
  r11713 | florian | 2008-09-05 23:35:12 +0200 (Fri, 05 Sep 2008) | 1 line
  
  + UnicodeString support for Variants
........
  r11715 | florian | 2008-09-06 20:59:54 +0200 (Sat, 06 Sep 2008) | 1 line
  
  * patch by Martin Schreiber for UnicodeString streaming
........
  r11716 | florian | 2008-09-06 22:22:55 +0200 (Sat, 06 Sep 2008) | 2 lines
  
  * fixed test
........
  r11717 | florian | 2008-09-07 10:25:51 +0200 (Sun, 07 Sep 2008) | 1 line
  
  * fixed typo when converting tunicodestring to punicodechar
........
  r11718 | florian | 2008-09-07 11:29:52 +0200 (Sun, 07 Sep 2008) | 3 lines
  
  * fixed writing of UnicodeString properties
  * moved some helper routines to unicode headers
........
  r11734 | florian | 2008-09-09 22:38:55 +0200 (Tue, 09 Sep 2008) | 1 line
  
  * fixed bootstrapping
........
  r11735 | florian | 2008-09-10 11:25:28 +0200 (Wed, 10 Sep 2008) | 2 lines
  
  * first fixes for persisten unicodestrings
........
  r11736 | florian | 2008-09-10 14:31:00 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  Initialized merge tracking via "svnmerge" with revisions "1-11663" from 
  http://svn.freepascal.org/svn/fpc/trunk
........
  r11737 | florian | 2008-09-10 21:06:57 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  * fixed unicodestring <-> variant handling
  * fixed unicodestring property reading
........

git-svn-id: trunk@11739 -
2008-09-10 20:14:31 +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
615619804a + set node complexity of const. string nodes to 1
+ better approximation if a tmp. location for a parameter when inlining can be omitted

git-svn-id: trunk@11635 -
2008-08-23 07:25:53 +00:00
Jonas Maebe
5feba9b3d7 * also free memory when a destructor is called without an explicit
instance reference (mantis 11896)
  * fixed double destructor call in tests/test/cg/tcalcla1.pp which
    caused an error after this change

git-svn-id: trunk@11599 -
2008-08-17 12:38:41 +00:00
Jonas Maebe
6d0326a55b * don't call procvars passed to formal parameters (mantis #11861)
git-svn-id: trunk@11592 -
2008-08-16 14:40:51 +00:00
yury
d5c0ba9a1e * Improved warning about constructing class instance with abstract methods. Warning is issued for each method and method name is specified in the message. It makes easy to find out which abstract methods still not overrode.
git-svn-id: trunk@11450 -
2008-07-23 12:24:25 +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
yury
e25713515b * Fixed memory leak.
git-svn-id: trunk@11437 -
2008-07-23 08:59:25 +00:00
Jonas Maebe
6ac63bcafe * also process tcallnode.funcretnode in nutils.foreachnode*(),needed
for properly synchronizing regvars after loops. The absense of this
    causes the crash in the test program of mantis #11290 under 2.2.1,
    and while it doesn't crash under 2.3.1 due to differences in the
    code generation, the bug could cause errors in other situations
    here as well)

git-svn-id: trunk@10959 -
2008-05-12 20:50:43 +00:00
micha
83b7f81f81 + add no-fpu support to compiler/rtl for powerpc-linux (-Cfnone)
git-svn-id: trunk@10422 -
2008-03-02 12:59:02 +00:00
Jonas Maebe
59d9169bbd * perform typechecking of callinit/callcleanup statements immediately when
they are added (mantis #10807), because
   a) the typecheckpass of the entire blocks has to be postponed until firstpass
      because new statements may still be added in the firstpass (otherwise
      the newly added statements in the firstpass are never typechecked due to
      the blocknode already having a resultdef set)
   b) simplify can be called between the typecheck and firstpass, and it needs
      the typeinfo

git-svn-id: trunk@10263 -
2008-02-10 11:13:33 +00:00
peter
169516ffc0 * don't optimize funcret with assignment result if the value is also used
as a parameter and the funcret is also passed as parameter. Because in that
    case both are pointing to the same memory location

git-svn-id: trunk@10159 -
2008-02-02 17:39:28 +00:00
Jonas Maebe
3521d64f4b - removed "do_count" parameter from tcallparanode.insert_typeconv
because the method was always called the same way (and it did not
    affect any counting anymore)
  * fixed and simplified read/write checking of methodpointer (mantis
    #10736)

git-svn-id: trunk@10155 -
2008-02-02 16:34:48 +00:00
Jonas Maebe
482b83c3cb * typecheckpass before calling do_simplify, as the siplify methods
assume that the resultdefs are available

git-svn-id: trunk@9652 -
2008-01-06 15:30:04 +00:00
Jonas Maebe
742ff35c48 + also optimize assignments from calls to by-reference "results":
o it's a by-reference parameter, but ignore that since it's
      guaranteed to be safe because of the escape analysis
    o it's wrapped in an absolute type conversion -> added
      actualtargetnode method to tnode which digs through that

git-svn-id: trunk@9412 -
2007-12-07 17:58:25 +00:00
Jonas Maebe
f38e190892 * don't substitute the result variable of an inlined function with
a regable variable, because this result variable of the inlined
    function may not be regable + test (mantis #10371)

git-svn-id: trunk@9409 -
2007-12-07 13:29:16 +00:00
Jonas Maebe
543faa46ad * do not inline functions/procedures called with things like "nil^"
(that can be passed to a const-by-reference or var parameter,
     but leads to errors when inlining)

git-svn-id: trunk@9281 -
2007-11-18 14:29:19 +00:00
Jonas Maebe
8f187bf6e2 * fixed r9243: that change should only be applied in case both the
parasym and the actual parameter  are a shortstring rather than
    when at least one isn't a shortstring

git-svn-id: trunk@9275 -
2007-11-17 19:58:19 +00:00
yury
4e3547c7bf * Improved warning "Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.":
- check for procedure and class pointers as well;
  - do not warn if typecasted pointer is passed as parameter or directly assigned to a variable. 

git-svn-id: trunk@9264 -
2007-11-16 13:52:19 +00:00
Jonas Maebe
2e9db26750 * truncate constant shortstrings at the callee side if they are passed
to a value parameter with a shorter length, and if they would not be
    implicitly passed by reference (if they are passed by reference, then
    the callee will perform a shortstring assign which will do the length
    truncation). Fixes tarray3 on x86_64

git-svn-id: trunk@9243 -
2007-11-13 20:21:29 +00:00
florian
a5ccf16016 + disp. var. property setting, resolves #10133 and #9134
git-svn-id: trunk@9189 -
2007-11-11 14:14:05 +00:00
florian
7878f0feb3 * made all fpc_*_to_shortstr helpers a procedure, resolves #8580
git-svn-id: trunk@8898 -
2007-10-21 17:33:18 +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
b79e4ff3f0 * fixed typo that broke non-i386 compilation after r8603
git-svn-id: trunk@8609 -
2007-09-22 20:46:45 +00:00
Jonas Maebe
93aad97c22 * Also take into account the node complexity of parameters to determine
the order in which they are evaluated (except for LOC_REFERENCE
    parameters on i386, because the code generator expects them in their
    original order). This saves quite a lot of spilling and uses of
    non-volatile registers when the parameters themselves also contain
    calls

git-svn-id: trunk@8603 -
2007-09-22 17:22:17 +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
Jonas Maebe
2146ad614c * fixed toperator5 after r8558. The inlining logic did not take into
account that an unmodified value parameter's address could also be
    passed as the address of the complex return value (and thus be modified
    indirectly after all)

git-svn-id: trunk@8570 -
2007-09-20 18:27:59 +00:00
Jonas Maebe
4d1c4091ba + added pm_preprocess support to foreachnode
* preprocess rather than postprocess the replaceparaloads in ncal
    when inlining, because after r8558 a node is now sometimes replaced
    by a tree which still contains this same node (so postprocess
    causes endless recursion in those cases)

git-svn-id: trunk@8561 -
2007-09-19 09:17:57 +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
Jonas Maebe
666d156e8e * disabled inlining when passing a refcounted parameter typecasted to
a non-refcounted type to a procedure, as this is incompatible with
    the inlining process

git-svn-id: trunk@8391 -
2007-09-07 10:40:26 +00:00
Jonas Maebe
e1aefdbac5 * Improved escape analysis so the improved tretopt no longer fails.
The downside is that because it is context-insensitive, several
    (correct) optimizations which were performed in the past no longer
    are now (and while some new ones are done now, the downside is bigger
    -- but at least the code should be correct in all cases now)

git-svn-id: trunk@8385 -
2007-09-05 13:29:22 +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
b1631b6918 * fixed wrong uninitialized warnings with passing array elements
as out-parameters

git-svn-id: trunk@8337 -
2007-08-29 20:23:59 +00:00
peter
98cc116dd2 * fix passing string to open array of string
git-svn-id: trunk@8137 -
2007-07-22 19:44:56 +00:00