Commit Graph

1105 Commits

Author SHA1 Message Date
Ondrej Pokorny
55629aeb19 do not publish enums with jumps 2022-08-16 20:47:44 +02:00
Sven/Sarah Barth
27c1bb3bea * an objectdef also requires an init for its members if a member (or a member of one of the parents) has a complex initialization
+ added test
2022-08-14 15:42:32 +02:00
Jonas Maebe
9e7895575e tarraydef.elecount: fix overflow detection
It did not trigger in case of an array[0..high(asizeint)]. Fixes compilation
of webtbs/tw9039[ab] with a compiler built with range checking enabled.
2022-05-29 13:33:27 +02:00
florian
45bf47ee05 * compilation with -O3 fixed 2022-05-26 22:34:34 +02:00
Sven/Sarah Barth
9aac622dc9 + add necessary core functions and functionality to implement capturing of variables
Based on code by Blaise.ru
2022-05-26 21:44:22 +02:00
Sven/Sarah Barth
90ebeb275a + add utility function to retrieve a file position of a usage of a type symbol from a type's definition 2022-05-26 21:43:40 +02:00
Sven/Sarah Barth
5cf15be434 + add a constructor for trecorddef to declare an internal record type as part of a specific other type
Based on code by Blaise.ru
2022-05-26 21:43:37 +02:00
Sven/Sarah Barth
7de854ef1e + add method register_implemented_interface to tobjectdef which registers an implemented interface and - if desired - also initializes the GUID related fields of the objectdef
* use that method in all locations outside symdef that add add an implemented interface

Based on work by Blaise.ru
2022-05-26 21:43:37 +02:00
Sven/Sarah Barth
76d3a9c4b5 * generate a better name if the procdef is an anonymous one 2022-05-26 21:43:36 +02:00
Sven/Sarah Barth
2be8f01efe * implement assignment of anonymous functions to procedure or method variables if they either capture nothing or (in case of method variables) at most the Self variable 2022-05-26 21:43:01 +02:00
Sven/Sarah Barth
d56a90e5ed * keep track of symbols that are accessed from a nested/anonymous function that belong to a surrounding scope 2022-05-26 21:43:01 +02:00
Sven/Sarah Barth
7f3a5eb9ab * extend tabstractprocdef.getcopyas by a parameter to control whether the copy should be registered or not 2022-05-26 21:42:59 +02:00
Sven/Sarah Barth
5e148c1dca + add a new tproccopytyp pc_normal_no_paras to copy an abstractprocdef without its parameters (useful if the parameters themselves will be reused and the original def otherwise deleted) 2022-05-26 21:42:56 +02:00
Sven/Sarah Barth
3aebcccdf2 * allow procvars to not be registered right away 2022-05-26 21:42:52 +02:00
Sven/Sarah Barth
a764c035b2 * if the symbol belongs to the current def also consider it a specialization if it's a nameless type symbol from an implicit function specialization as their owner gets changed to the function itself 2022-05-26 21:42:52 +02:00
Sven/Sarah Barth
8bef91d1de * declare the type symbol of an internal def as sp_internal 2022-05-26 21:42:52 +02:00
Sven/Sarah Barth
30a7199165 * make the VMT symbol and type def of the corresponding class or object instead of having them be global
* bump PPU version to avoid potential compilation errors due to this

Based on code by Blaise.ru
2022-05-26 21:42:51 +02:00
Jonas Maebe
3d3c904ac5 TSymStr: more consistent usage 2022-05-08 15:03:44 +02:00
Jonas Maebe
fcaea21075 SymAnsiStr: fix "make all" and webtbs/tw39661*
Fixes compilation with LLVM backend
2022-05-08 14:59:36 +02:00
Pierre Muller
5acd7a7b83 Rename tsymtable.insert and delete methods to insertsym ands deletesym 2022-05-03 23:00:28 +02:00
Sven/Sarah Barth
90844c2027 * fix #35261: apply slightly adjusted changes by Ryan Joseph to implement support for implicit generic function specializations
The main adjustments were as follows:
  - fixing coding style and identation
  - fixing some typos
  - using a better name for the property in tcallcandidates which holds the symbols created for anonymous parameter values
2022-04-20 18:59:31 +02:00
ccrause
665c1b3966 Move member variable "section" to tprocdef. Type of "section" to agree with symansistr define. 2022-02-22 20:51:32 +00:00
ccrause
738a0a35de Add section directive for subroutines for embedded and freertos systems. 2022-02-22 20:51:32 +00:00
Yuriy Sydorov
b78761efd3 * Removed obsolete OLDREGVARS ifdefs. 2021-11-02 17:08:08 +02:00
florian
a4672fbd1c o based on a patch by Rika, resolves #39401:
* use Base64 (62=_, 63=$) encoded FNV hash (instead of CR-32) to shorted identifiers
    * renamed fpccrc to fpchash
    + test
2021-10-10 10:09:22 +02:00
Jonas Maebe
3fb0fab410 Fix bitpacking 62/63 bit fields on 64 bit targets
As reported on the lazarus forum:
* https://forum.lazarus.freepascal.org/index.php?topic=56341.new
* https://forum.lazarus.freepascal.org/index.php/topic,56339.msg418608/topicseen.html

Also optimized nextpowerof2 in the compiler
2021-10-03 14:00:50 +02:00
Jonas Maebe
fcb646bc3b obcpas: fix categories implementing protocols
Allocate the ImplementedInterfaces array for them and save to/load from ppu

Solves #39375
2021-09-25 16:15:45 +02:00
nickysn
3ecb41cd2d * improvements to the prevention of dangling pointers in tmodule.deflist,
introduced in r49417. Now it no longer depends on current_module, so it
  handles the case when current_module changes between the time the tdef was
  registered and the time it was freed. It also supports freeing the tmodule
  before the defs, so the freeing order of the object is once again flexible.

git-svn-id: trunk@49426 -
2021-06-01 15:02:26 +00:00
nickysn
ea5ffd597f * set self to nil in current_module.deflist for registered defs in the
tstoreddef.destroy destructor, instead of doing it after each call to
  x.owner.deletedef(x)

git-svn-id: trunk@49417 -
2021-05-30 21:27:57 +00:00
florian
fe57cd3536 * fix LLVM after r48828
* global gotos really use the return type of fpc_setjmp to test where we come from

git-svn-id: trunk@48835 -
2021-02-27 22:07:58 +00:00
florian
4c2e0b9ff0 * for setjmp based exception handling, get the type of the exception reason from the setjmp result
git-svn-id: trunk@48828 -
2021-02-27 16:47:36 +00:00
florian
857cbddf04 * applied patch by Pierre to fix make cycle -Cr
git-svn-id: trunk@48806 -
2021-02-24 21:10:05 +00:00
florian
34f7c3e6d4 + array defs. of open arrays are now marked by ado_OpenArray, so (internally!) zero sized array can be declared with 0..-1
git-svn-id: trunk@48758 -
2021-02-21 18:45:58 +00:00
yury
64c586b86d * Removed/ifdefed lots of unused variables.
git-svn-id: trunk@48384 -
2021-01-24 12:24:01 +00:00
svenbarth
cc92af8423 * apply patch by Blaise.ru to enable the correct generation of names for classes/interfaces inside local symtables; these will be required for reference function types which are in fact interfaces and classes, this does not mean that ordinary classes can be declared inside functions
Note: no test as the functionality is not yet used

git-svn-id: trunk@47834 -
2020-12-22 22:22:35 +00:00
svenbarth
cbe352808a * fix for Mantis #38238: when creating a copy of a procdef for a procvar set the methodpointer flag also for methods of records
+ added test

git-svn-id: trunk@47826 -
2020-12-20 22:41:27 +00:00
svenbarth
32938dde1c * apply patch by Blaise.ru to allow record methods to be assigned to method variables as well (this is Delphi compatible)
+ added test

git-svn-id: trunk@47794 -
2020-12-16 21:43:25 +00:00
pierre
6230de31bb * Second patch xml-node-dump-defs.patch from J. Gareth Moreton from bug report 36882.
With same changes to ensure that xmllint find no errors in generated xml files.

git-svn-id: trunk@47667 -
2020-12-02 21:01:40 +00:00
florian
d5e20fa6a9 * take variant alignment from TVARDATA, should resolve #38022
git-svn-id: trunk@47286 -
2020-11-02 22:16:18 +00:00
florian
3b0168ae16 * (slightly) modified (formatting, warning) patch by Jan Bruns to speed up overloading search, resolves #36666
git-svn-id: trunk@47111 -
2020-10-14 20:08:10 +00:00
svenbarth
eb7158d250 * ensure that internal method names (namely operator overloads and class con-/destructors) result in different mangled names from ordinary methods even if they should be converted to lowercase (which happens for section names)
+ added tests

git-svn-id: trunk@47110 -
2020-10-14 09:11:44 +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
svenbarth
d1521e8061 * a classrefdef might also be created with a forwarddef, so handle that correctly
git-svn-id: trunk@46850 -
2020-09-11 21:24:59 +00:00
Jonas Maebe
cc315e0ac7 * fix tw3930 after r37927
o "unique" class (and interface) type aliases should actually not exist at
     all except for overload resolution. All the rest (VMT, UUID, RTTI, ...)
     should be taken from the aliased class/interface
   o there is one Delphi-incompatibily left after this change, but it shouldn't
     matter: tw8180 does not compile if you change the declaration to
     "tcl=class(TInterfacedObject,XStr,iinterface)", while Kylix does compile
     that. It doesn't really matter though, because in Kylix this actually
     adds iinterface twice as implemented interface, so there is no point
     in accepting this.

git-svn-id: trunk@46773 -
2020-09-05 12:25:09 +00:00
yury
222f981dd1 * 8086: Fixed Ofs() for far routines.
resultdef of typeconvnode.typecheck_proc_to_procvar() is reused every time you get an address of a proc. So it is forbidden to change the far/near attribute of resultdef - it leads to mess during code generation. 
  Instead it is needed to use separate reusable resultdefs with new flags pc_far_address and pc_offset.

git-svn-id: trunk@46470 -
2020-08-17 13:37:55 +00:00
florian
14bc6674a6 * revert part of r45810 which was accidently committed
git-svn-id: trunk@45813 -
2020-07-20 20:21:44 +00:00
florian
d6d92e3666 * revert part of r44879: flock must use kernel_off_t: off_t breaks e.g. i386
git-svn-id: trunk@45810 -
2020-07-19 19:54:22 +00:00
Jonas Maebe
3e9e0a0f7d * completely disable records containing float fields in registers again, as
the code generator does not support subsetreg loads of floats

git-svn-id: trunk@45800 -
2020-07-17 20:57:20 +00:00
Jonas Maebe
e7d1a77f9a * rename the ARM/AArch64-Darwin targets to ARM/AArch64-iOS
* rename the m68k/PowerPC-MacOS targets to m68k/PowerPC-MacOSClassic
  * repurpose the AArch64/Darwin target for AArch64/macOS
   o make AArch64-Darwin default target for a hosted AArch64-Darwin compiler

git-svn-id: trunk@45758 -
2020-07-10 21:52:24 +00:00
svenbarth
f94518a9ae * fix typo (no code changes)
git-svn-id: trunk@45680 -
2020-06-22 20:39:55 +00:00