Commit Graph

737 Commits

Author SHA1 Message Date
florian
00af340feb * cleanup
git-svn-id: trunk@47774 -
2020-12-14 21:55:41 +00:00
yury
8b7c5666a2 * Renamed fc_block_with_exit to fc_no_direct_exit to expand its usage.
* Set fc_no_direct_exit in case when a routine has an additional implicit exit code, such as calling FreeInstance in the destructor.

git-svn-id: trunk@47749 -
2020-12-10 17:38:37 +00:00
pierre
a7232669ff * Adapted from patch node-dump-pass-1.patch submitted by J. Gareth Moreton from bug report 38156.
This patch extends the DEBUG_NODE_XML debug feature by also outputting, 
     to the *-node-dump.xml files, the node tree as it appears after the first pass, 
     since it often contains many more internal nodes like temporary allocations that may need
     to be evaluated for debugging and development purposes, or node-level optimisation opportunities.

git-svn-id: trunk@47709 -
2020-12-07 07:28:04 +00:00
florian
9c6bdcfbb7 * fix in r47632 should be enabled for all targets as it is a stack tainting
parameter

git-svn-id: trunk@47680 -
2020-12-03 21:22:07 +00:00
pierre
af17e9460b Apply patch proposed by J. Gareth Moreton in:
bug report #0036882: [Feature] Class and record definition XML dump extension

  These patches extend the node dump feature (enabled with DEBUG_NODE_XML)
  so it also dumps class and record definitions to the XML file. They are contained within <definition> tags.
  Currently only fields and constants are dumped to the XML file. Methods, constant and variable definitions may be added later.

git-svn-id: trunk@47658 -
2020-12-01 11:45:14 +00:00
florian
c47d6d7af0 * check if an invisible parameter for the result occupies parameter space
git-svn-id: trunk@47632 -
2020-11-29 13:38:33 +00:00
florian
fbb2e63fea + #QLvember work: stack frame optimization for m68k
git-svn-id: trunk@47629 -
2020-11-29 10:16:00 +00:00
florian
3baddff71e + inline subroutines with formal parameters as well
git-svn-id: trunk@47214 -
2020-10-26 22:18:03 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
florian
93eef547ae * improve call0 calling conventions
git-svn-id: trunk@46797 -
2020-09-07 20:28:38 +00:00
florian
250c0750a2 * Xtensa: several issues with parameter passing of the windowed api fixed
git-svn-id: trunk@46708 -
2020-08-26 21:03:42 +00:00
svenbarth
c2c7ac634a * fix for Mantis #37616: apply patch by Kai Burghardt to complain about the correct type used by setjmp/longjmp
git-svn-id: trunk@46542 -
2020-08-22 13:33:53 +00:00
yury
aefc1be555 * Reverted accidentally committed files.
git-svn-id: trunk@46416 -
2020-08-13 18:48:19 +00:00
yury
7b65f85a0b * Accidental commit.
git-svn-id: trunk@46415 -
2020-08-13 18:46:57 +00:00
yury
e63c03125a * Reworked tprocdef.is_implemented to fix a bug with the parentfp optimization. The bug was detected when using the llvm backend.
+ Added a test.

git-svn-id: trunk@45675 -
2020-06-21 19:52:14 +00:00
svenbarth
c45c543faa * fix typo (no code changes)
git-svn-id: trunk@45644 -
2020-06-13 18:42:21 +00:00
yury
2808873d1b * Reworked the optimization of unused $parentfp for nested routines.
- Do not remove the $parentfp parameter as was done in the previous optimization approach. Instead when $parentfp is unused to the following:
      - On the caller side: Omit passing the value for $parentfp for targets where tcgcallparanode.push_zero_sized_value_para=false (classic CPU targets). 
          Pass 0/nil as $parentfp for targets where tcgcallparanode.push_zero_sized_value_para=true;
      - On the callee side: Prevent allocation of registers/resources for $parentfp.
  - When possible keep $parentfp in a register.
  - Set the pio_nested_access flag in tprocinfo.set_needs_parentfp() to properly handle deep nesting levels;

git-svn-id: trunk@45436 -
2020-05-19 13:17:47 +00:00
florian
af0ba7be83 * when auto-inlining is used, do not require that inlining is explicitly turned on
git-svn-id: trunk@45405 -
2020-05-17 18:14:48 +00:00
florian
2a2ec77b10 * improved heuristics for auto-inlining
git-svn-id: trunk@45328 -
2020-05-10 19:41:13 +00:00
yury
254d0c0e2c * Do not perform optimization of nested procedures for:
- targets which use a special struct to access parent's variables;
  - pure assembler procedures (for compatibility with old code).

git-svn-id: trunk@45322 -
2020-05-09 20:45:00 +00:00
yury
40504a6f9d * If a nested procedure does not access its parent's frame pointer, optimize it by removing the hidden $parentfp parameter.
* Improved the tisogoto1.pp test.

git-svn-id: trunk@45292 -
2020-05-06 14:43:49 +00:00
svenbarth
2b59000d56 + implement compiler support for SEH on Win64
Note: due to the way we access variables in a nested function (which in this case includes exception filters) we can not extract the finally handlers and call them (like we do on i386 and x86_64, but instead we duplicate the finally code)

git-svn-id: trunk@44941 -
2020-04-21 06:06:05 +00:00
svenbarth
fed17122f8 * as a variant for SEH exception filters we allow them to be *duplicated* instead of being extracted; this can be done unconditionally as for extracted ones their code is set to Nil after they're done and thus won't be picked up by generate_code_exceptionfilters
git-svn-id: trunk@44934 -
2020-04-21 06:05:35 +00:00
svenbarth
12ef066897 + add functionality to store a node tree's required temp nodes and their flag upon entering the tree
git-svn-id: trunk@44924 -
2020-04-21 06:04:59 +00:00
svenbarth
068f0d2ec8 * fix for Mantis #36935: apply patch by J. Gareth Moreton to fix a typo in cs_opt_remove_empty_proc
git-svn-id: trunk@44888 -
2020-04-20 18:42:30 +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
svenbarth
147559349b * fix for Mantis #36652: gracefully handle the error if one tries to implement a method of a type from another unit
+ added test

git-svn-id: trunk@44170 -
2020-02-14 16:48:58 +00:00
Jonas Maebe
254b85c352 + new pio_inline_forbidden flag to indicate that while parsing the
implementation the compiler determined the routine must never be
    inlined
   o difference with po_noinline: can also be set in the implementation
   o difference with pio_inline_not_possible: it indicates that e.g.
     LLVM must not inline the routine either

git-svn-id: trunk@44065 -
2020-01-29 22:21:17 +00:00
Jonas Maebe
b625afe800 * never inline routines that call get_frame (otherwise get_frame would return
the frame of the caller rather than of the current routine, which could
    cause e.g. stackframes to be missed in RTL helpers that are known to be
    only called from run time error routines)

git-svn-id: trunk@44064 -
2020-01-29 22:21:14 +00:00
florian
931d4dcfee * ensure the rtl and the packages for embedded compile with features exceptions and classes disabled
git-svn-id: trunk@43931 -
2020-01-13 21:20:03 +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
6f87a572af * factored out tcgprocinfo.OptimizeNodeTree
git-svn-id: trunk@43907 -
2020-01-10 21:47:20 +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
svenbarth
f13200d68b * restore localswitch settings after the initialization and finalization code was generated
git-svn-id: trunk@43535 -
2019-11-21 21:44:19 +00:00
florian
af8783e8d2 * i386: with a fixed stack, exception handling does not need a frame pointer
git-svn-id: trunk@43218 -
2019-10-17 20:55:39 +00:00
florian
7ee889d4ec * it must be decided in allocate_tls_register if a tls register is allocated
git-svn-id: trunk@43131 -
2019-10-05 20:48:28 +00:00
florian
c3f4ad39a3 * it must be decided in g_maybe_tls_init if a tls is loaded
git-svn-id: trunk@43126 -
2019-10-05 20:48:24 +00:00
florian
11319353fd * loading a got depends only on the fact if a got is needed and not if pic shall be generated
git-svn-id: trunk@43075 -
2019-09-25 21:19:06 +00:00
Jonas Maebe
9678542ba6 + add "thunk" attribute for stubs/thunks and emit it for LLVM
- also removed wrong "noreturn" attribute for interface thunks generated
     for high level code generator targets

git-svn-id: trunk@43018 -
2019-09-15 20:43:12 +00:00
Jonas Maebe
a051b8d225 - remmoved doregister parameter from t*sym constructors, as the registration
is handled automatically nowadays

git-svn-id: trunk@42998 -
2019-09-14 17:30:45 +00:00
Károly Balogh
4d6b8a6c45 fixed the messy state of messages after recent custom attributes merge. fixed a typo, fixed double definition of message 3350, restored a message that was removed but still used, so the build passes at least.
git-svn-id: trunk@42412 -
2019-07-13 07:34:07 +00:00
svenbarth
3a02393584 - remove functionality to get the code block when parsing again (let's open this pandora's box only when really needed...)
git-svn-id: trunk@42397 -
2019-07-12 22:07:31 +00:00
svenbarth
b2932393df Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 1/3]
Implemented attributes for class types and properties (based on work by Joost van der Sluis). Added TCustomAttribute - a base class for attributes. Added TUnitInfo record to RTTI. It contains the unit name and unit options (for now only a flag which specifies if the unit contains attributes). Added several tests for attributes.

git-svn-id: trunk@42356 -
2019-07-12 22:04:48 +00:00
Jonas Maebe
e56b58c2b0 * factored out checks whether a procdef's symbol needs to be global, and
the generation of the procdef's asmsymbols
   o also removed unnecessary definition of procdef alias symbols for Darwin
     (they are already defined in ncgutil.alloc_proc_symbol)

git-svn-id: trunk@42341 -
2019-07-07 21:33:47 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
pierre
67cf63049d Commit patch submitted in bug report #35787 by Gareth Moreton
git-svn-id: trunk@42318 -
2019-07-01 19:42:48 +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
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +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