Commit Graph

266 Commits

Author SHA1 Message Date
florian
61d44bba17 * allow iso gotos within a procedure
git-svn-id: trunk@46396 -
2020-08-12 19:07:23 +00:00
svenbarth
55c1ecedac * set implicitframe for copied tryfinally nodes as well
git-svn-id: trunk@44956 -
2020-04-21 06:07:03 +00:00
florian
aca9727418 + OptimizeForLoop: convert for-loops into zero-based backward for-loops if possible, for most architectures, this results in simpler code
git-svn-id: trunk@44287 -
2020-03-08 14:30:59 +00:00
florian
1486ab7c70 * do not throw a warning about unreachable code if the responsible node was generated internally
git-svn-id: trunk@44051 -
2020-01-27 22:27:22 +00:00
florian
22197641b8 * last commit fixing calculation of do_loopvar_at_end was not complete,
hopefully finally fixed

git-svn-id: trunk@44041 -
2020-01-26 20:13:17 +00:00
florian
74272975af * do_loopvar_at_end is not possible if the loop counter would overflow with
the last iteration

git-svn-id: trunk@44039 -
2020-01-26 15:35:03 +00:00
florian
069e040e49 * do for-loop unrolling after for-loop simplification, resolves #36589
git-svn-id: trunk@43999 -
2020-01-19 18:21:12 +00:00
florian
2f2b378c03 * moved conversion of for into while loops in a separate pass, so node optimizations on the node tree can be
carried out without losing information from for loops

git-svn-id: trunk@43910 -
2020-01-11 16:08:45 +00:00
florian
f424ae3929 - cleanup comment
git-svn-id: trunk@43906 -
2020-01-10 21:34:30 +00:00
florian
fd0012deff * when copying goto nodes take care if the label node is part of the copied tree
or not, resolves #35820

git-svn-id: trunk@43793 -
2019-12-25 17:10:14 +00:00
Jonas Maebe
e775ecdc43 * cleaned up safecall support: use a hidden localvarsym instead of result
register hacking
   o this also allowed fixing/adding safecall support for LLVM

git-svn-id: trunk@43578 -
2019-11-24 20:23:22 +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
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
Jonas Maebe
e3e23df7e2 * document how tgotonode/tlabelnode copying works
git-svn-id: trunk@42986 -
2019-09-13 19:06:34 +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
Jonas Maebe
50c82b6468 * synchronised with trunk till r41537
git-svn-id: branches/debug_eh@41538 -
2019-03-01 16:20:22 +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
florian
f66d7d431f * ensure that the label points inside the range where the raise is located for psabieh
git-svn-id: branches/debug_eh@41384 -
2019-02-19 22:19:30 +00:00
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
Jonas Maebe
51e68eb302 * fixed several places where the interface crc could change:
o unsetting po_inline while parsing the implementation for various reasons
     (interprocedural goto/label, accessing a local in a parent frame,
      having nested procedures)
   o instead handle this via the pio_inline_not_possible flag
   o noreturn can no longer be specified only in the implementation

git-svn-id: trunk@40789 -
2019-01-06 20:35:56 +00:00
Jonas Maebe
51b58f342f * synchronised with trunk till r40775
git-svn-id: branches/debug_eh@40776 -
2019-01-05 22:12:28 +00:00
Jonas Maebe
91d5457b38 * moved around/replaced the following procedures to stop nflw from depending
on pdecsub (node units should not depend on parser units):
   o maybe_add_public_default_java_constructor()
   o handle_calling_convention()
   o create_finalizer_procdef() (replaced with create_outline_procdef())
   o insert_record_hidden_paras()
   o handle_calling_convention()
   o proc_add_definition()
   o build_parentfpstruct()
   o maybe_guarantee_record_typesym()
   o get_first_proc_str()
  * factored out the creation of a procinfo for a nested procdef based on a
    subnodetree of the current procdef into tprocinfo.create_for_outlining()

git-svn-id: trunk@40773 -
2019-01-05 16:26:33 +00:00
Jonas Maebe
28df55fe08 * moved handle_calling_convention() to pparautl
git-svn-id: trunk@40772 -
2019-01-05 16:26:29 +00:00
Jonas Maebe
c7d701d117 * synchronised with trunk till r40038
git-svn-id: branches/debug_eh@40643 -
2018-12-25 15:38:57 +00:00
Jonas Maebe
f754978540 * handle constructor function results that have been migrated to the
parentfpstruct the same as regular function results (see r32687)

git-svn-id: trunk@40641 -
2018-12-25 15:36:24 +00:00
Jonas Maebe
03013cf2e1 * make ttryfinallynode inherit from ttertiary node so it has a "third" node
member. This one will be used by the LLVM descendent to keep a copy of
    the finally code, as it must use a separate version for the code that
    gets executed when an exception is caught and when no exception happens

git-svn-id: branches/debug_eh@40416 -
2018-11-29 21:31:34 +00:00
Jonas Maebe
0cd85d73e4 * ttryfinallynode now inherits from tbinarynode instead of tloopnode, as its
t1 field was always set to tnothingnode

git-svn-id: trunk@40142 -
2018-11-01 13:19:33 +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
3b3e33d863 + correctly set var state of addr and frame in raise statements, resolves #33818
git-svn-id: trunk@39162 -
2018-06-03 09:31:19 +00:00
Jonas Maebe
a2217cedd5 * evaluate the lower and upper bounds of for-loops in ISO mode using the
ISO-defined range type, instead of using the type of the iteration
    variable (mantis #24318)

git-svn-id: trunk@37934 -
2018-01-07 18:51:53 +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
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
svenbarth
c6f19b9888 * create_for_in_loop: if there's a choice between iterating an array and a set then prefer the set for backwards compatibility
git-svn-id: trunk@36097 -
2017-05-04 21:38:00 +00:00
svenbarth
a8b1d340c7 * create_for_in_loop: explicitely convert "for ... in [] do" to a nothing-node including an unreachable code warning (avoids code conversions that are for naught anyway)
git-svn-id: trunk@36096 -
2017-05-04 21:37:12 +00:00
yury
54f1890fea * Fixed memory leak of tlabelnode.labsym.
git-svn-id: trunk@35538 -
2017-03-07 10:14:59 +00:00
yury
5405a4727a * Removed unused vars.
git-svn-id: trunk@35535 -
2017-03-07 08:56:07 +00:00
florian
8471e02e40 * call simplify after typechecking for nodes
git-svn-id: trunk@34795 -
2016-11-05 23:05:54 +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
florian
0610187878 + transform for loop into equivalent while loop during pass 1 to simplify code generation
git-svn-id: trunk@34788 -
2016-11-05 23:05:43 +00:00
Jonas Maebe
051317e82e * load the function result from the parentfpstruct to its original location
in exit nodes, because the wrapping code added in
    tnodeutils.wrap_proc_body() gets inserted before the exit label to which
    the exit node jumps

git-svn-id: trunk@34305 -
2016-08-13 14:47:50 +00:00
Jeppe Johansen
e20f2111b7 Check for nil before doing loopunrolling.
git-svn-id: trunk@33047 -
2016-02-04 15:53:36 +00:00
Jonas Maebe
95927665ce - removed variable notification support, it's not used and superceded by
DFA

git-svn-id: trunk@31916 -
2015-10-02 17:00:25 +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
svenbarth
65c37df999 + extend tprocdef with the possiblity to create it as unregistered
* for now all procdefs are created as registered
Note: an additional parameter instead of an overload is used for tprocdef.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes...

git-svn-id: trunk@31593 -
2015-09-11 13:36:00 +00:00
Jonas Maebe
201121d7c9 * synchronised with trunk till r30345
git-svn-id: branches/hlcgllvm@30349 -
2015-03-28 12:28:15 +00:00
florian
0bc63c438e + tifnode.create_internal
git-svn-id: trunk@30268 -
2015-03-21 22:55:35 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
florian
f813703cf3 * fixes several issues with loop unrolling
git-svn-id: trunk@29362 -
2014-12-31 15:45:06 +00:00
florian
f630fb94b5 * do not warn when internally generated if nodes are simplified
git-svn-id: trunk@29292 -
2014-12-14 19:40:17 +00:00
Jonas Maebe
5c75b6dd6b * synchronised with trunk up till r28402
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00