[fpc-devel] creating call nodes for managed operators
Benito van der Zander
benito at benibela.de
Wed Jul 26 02:03:29 CEST 2023
i have found the problem
> views.inc(4318,17) Error: Wrong number of parameters specified for call to "$copy"
that is not what it says
It has nothing to do with the parameters. FPC generates this message if
no matching callable function is not found for any reason
In this case because "copy" was not public in the record. I can set a
flag [cnf_ignore_visibility] in the compiler
On 23.07.23 16:35, Hairy Pixels via fpc-devel wrote:
>> On Jul 23, 2023, at 7:13 AM, Benito van der Zander via fpc-devel<fpc-devel at lists.freepascal.org> wrote:
>> with my patch, "copy" can be inlined!
>> initialize and finalize some times, too.
>> There are two places that call them. compiler/nld.pas and compiler/ngenutil.pas where it creates the call nodes. There my patch turns them into ordinary function calls, which can be inlined like any other function call.
> This is the "old way" you describe. Why did they do it like this instead of normal function calls which could be inlined? I suspect one of the compiler devs needs to explain this because there may be a reason.
>> Then there is compiler/hlcgobj.pas, which calls initialize/finalize for local or temporary variables. That appears to happen after the inlining is done. Perhaps it needs to do the inlining first to know which variables are there, and afterwards it could not change them anymore.
> So the inlining caused extra init/finalize calls? That's not good for sure. There's already a problem with an extra copy operator being called on temporary memory which can make or break the feature entirely depending on your usage.
> Ryan Joseph
> fpc-devel maillist -fpc-devel at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel