Alligator-1
9caabdc4e7
Immediately set the capacity
2024-07-08 20:17:11 +00:00
Sven/Sarah Barth
ad61db2ff5
* allow a nested function that calls itself can be converted to a function reference
...
+ added test
2023-12-30 14:47:38 +01:00
Sven/Sarah Barth
1853d1ddd8
* keep track which nested function definition the new method has been converted from
2023-12-30 14:45:41 +01:00
Sven/Sarah Barth
1606d4e28d
* only walk the node tree if there are indeed captured symbols to convert
2023-12-29 21:52:28 +01:00
Sven/Sarah Barth
ab5c5a7e9a
* also keep track of captured def (necessary when functions are captured)
2023-12-29 20:26:45 +01:00
Sven/Sarah Barth
b5b7cd54eb
* fix typo in comment
2023-12-29 20:24:53 +01:00
Sven/Sarah Barth
787454d5b2
* correctly handle managed function results when converting a global or nested function to a function reference
...
+ added test
2023-12-29 20:55:37 +01:00
Sven/Sarah Barth
ca0323d4ca
* the adjusted nested function needs to access the parent function for the capturer
2023-12-29 20:55:37 +01:00
Sven/Sarah Barth
08dca09c7e
* revert 430bcac389
as with the change that the functions to insert hidden parameters are idempotent this is no longer required and also wrong as uses of the deleted symbols aside from Self and the framepointer would be left dangling
2023-06-16 16:16:58 +02:00
Sven/Sarah Barth
430bcac389
* ensure that all hidden parameter symbols are removed when adding an anonymous function to a capturer (they'll be added again later on)
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
5d7e3ca240
* fix #40060 : ensure that Self is not added for anonymous functions that are part of a static class method
...
+ added test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
4c6338207f
* fix #40061 : the Self of types that aren't implicit pointers (recods, TP-style objects, primitive types (for helpers)) needs to be stored as a Pointer in the Capturer so that modifications are correctly visible
...
+ added tests
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
b051e7667c
* fix #39978 : ensure that Self is captured when a method of the current class is captured into a function reference
...
+ added test
2022-11-06 22:01:49 +01:00
Sven/Sarah Barth
19cee9b841
+ mark the def for a capturer class with a corresponding object option
2022-11-06 22:01:48 +01:00
Sven/Sarah Barth
a714e2ff35
* fix #39981 : retrieve the symbol that returns the desired procdef/procvardef not maybe the Self or something else as we need that symbol to differentiate the procdefs
...
+ added test
2022-11-06 22:01:48 +01:00
Sven/Sarah Barth
b11366c95b
* when generating the call to the extracted function reference inside the nested routine we need to use the parameters of the nested function and not those of the newly created procdef (fixes some of the test case failures with -O2)
2022-09-23 15:50:19 +02:00
Sven/Sarah Barth
965bba5ab4
* cleanup captured symbols when moving them from the nested function to the new method
2022-09-23 14:44:42 +02:00
Sven/Sarah Barth
4f9acc10f0
* fix #39898 : when a loadnode is captured ensure that its nf_load_procvar flag is applied to the subscript node as well
...
+ added tests
2022-09-20 00:01:49 +02:00
Sven/Sarah Barth
5e7330448d
* fix #39858 : correctly keep track of symbols that need to be captured into the capturer
...
+ added test
2022-08-12 17:44:39 +02:00
Sven/Sarah Barth
260368ea55
* the clause for converting the captured symbols of a nested function must not be entered by an anonymous function
2022-08-12 17:43:15 +02:00
florian
59811090e1
* captured variables cannot be in registers typically
2022-08-01 22:59:23 +02:00
Sven/Sarah Barth
8d90cd3e64
* fix #39826 : correctly handle function references that are part of generics/specializations, but are not generics/specializations themselves
...
+ added test
2022-07-15 16:32:02 +02:00
florian
98ec81896e
* do not throw messages on potentially uninitialized internal symbols, resolves #39744
2022-06-15 23:30:33 +02:00
Pierre Muller
430f1910ed
Fix compliation error with -Oodfa option as reported by Gareth
2022-06-01 00:35:55 +02:00
Sven/Sarah Barth
a27bc236a0
* fix #39742 : when assigning a function to a function reference it's not the function itself that needs to be checked to be captureable, but instead what it captures (this applies for both the non-generic and the generic case)
...
+ added tests
2022-05-31 23:16:41 +02:00
Sven/Sarah Barth
3b7842c30e
* ensure that a nested function variable can not be assigned to a function reference
2022-05-31 22:50:14 +02:00
Jonas Maebe
59f293711a
function references: make names of interface methods valid Pascal identifiers
...
On high level targets, and on PowerPC/PowerPC64, interface method thunks are
implemented using internally-generated Pascal wrappers, so the method names
need to be valid Pascal identifiers.
Additionally, that wrapper code uses the procsym's realname, so also
update the realname field when changing the name of anonymous methods.
2022-05-29 23:07:13 +02:00
Sven/Sarah Barth
29cfa3b225
* ensure that the VMT for the function reference interface is generated correctly, but for this the invokedef needs to be copied without hidden parameters (and handle_calling_convention will be done by the VMT builder as well)
2022-05-29 14:44:11 +02:00
Sven/Sarah Barth
dadc10658c
* set the correct symtable level for the invoke procdef
2022-05-29 14:44:11 +02:00
Sven/Sarah Barth
0c9b622a74
* fix compilation with DEBUG_NODE_XML defined
2022-05-27 07:36:50 +02:00
Sven/Sarah Barth
f73fc7d566
* fix #39736 : ensure that the capturer object and any converted function reference interface are considered used
...
+ added test
2022-05-27 07:24:46 +02:00
Sven/Sarah Barth
7974f39522
* implement assignment of procedure and method variables and routines (global, instance and nested) to function references
2022-05-26 21:44:24 +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
2ed2c21313
+ add support for parsing function references
2022-05-26 21:42:59 +02:00
Pierre Muller
5acd7a7b83
Rename tsymtable.insert and delete methods to insertsym ands deletesym
2022-05-03 23:00:28 +02:00
svenbarth
4da6465d05
* correctly set the generic related defoptions for an outlined procdef
...
git-svn-id: trunk@45645 -
2020-06-13 18:42:26 +00:00
svenbarth
b1ee29c836
* fix for Mantis #30205 : (adjusted) patch by Do-wan Kim to only use the default calling convention for exception handlers
...
+ added test
git-svn-id: trunk@41277 -
2019-02-10 11:26:46 +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