Re: [fpc-pascal] Inline function parameters

2021-11-10 Thread Sven Barth via fpc-pascal
Am 11.11.2021 um 02:52 schrieb Ryan Joseph via fpc-pascal: On Nov 9, 2021, at 1:09 PM, Sven Barth via fpc-pascal wrote: No, because the function that is called with a function pointer needs to be inlined itself (thus becoming part of its caller) so that constant propagation works at all

Re: [fpc-pascal] Inline function parameters

2021-11-10 Thread Ryan Joseph via fpc-pascal
> On Nov 9, 2021, at 1:09 PM, Sven Barth via fpc-pascal > wrote: > > No, because the function that is called with a function pointer needs to be > inlined itself (thus becoming part of its caller) so that constant > propagation works at all for the parameters. If a function isn't inlined

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Sven Barth via fpc-pascal
Am 09.11.2021 um 02:45 schrieb Ryan Joseph via fpc-pascal: On Nov 8, 2021, at 11:20 PM, Sven Barth via fpc-pascal wrote: I don't know what you mean with "new function body". If a function is inlined its code is contained within the surrounding function and if it's not inlined then nothing

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Ryan Joseph via fpc-pascal
> On Nov 8, 2021, at 11:20 PM, Sven Barth via fpc-pascal > wrote: > > I don't know what you mean with "new function body". If a function is inlined > its code is contained within the surrounding function and if it's not inlined > then nothing changes. > I mean if in theory you were to

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 8. Nov. 2021, 15:31: > > > > On Nov 8, 2021, at 1:27 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > And there you have it (simplified obviously). As long as the compiler > can determine *at compile time* the code of

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Ryan Joseph via fpc-pascal
> On Nov 8, 2021, at 1:27 PM, Sven Barth via fpc-pascal > wrote: > > And there you have it (simplified obviously). As long as the compiler can > determine *at compile time* the code of the function (and the function is > inlineable) it should in theory be able to inline it. This is true no

Re: [fpc-pascal] Inline function parameters

2021-11-07 Thread Sven Barth via fpc-pascal
Am 08.11.2021 um 03:45 schrieb Ryan Joseph via fpc-pascal: On Nov 7, 2021, at 2:17 PM, Jonas Maebe via fpc-pascal wrote: Is there anyway a function parameter could be inlined in FPC? This would go a long way in helping to parameterize functions that have tight loops in them. It's

Re: [fpc-pascal] Inline function parameters

2021-11-07 Thread Ryan Joseph via fpc-pascal
> On Nov 7, 2021, at 2:17 PM, Jonas Maebe via fpc-pascal > wrote: > >> Is there anyway a function parameter could be inlined in FPC? This would go >> a long way in helping to parameterize functions that have tight loops in >> them. > > It's theoretically possible through constant

Re: [fpc-pascal] Inline function parameters

2021-11-07 Thread Jonas Maebe via fpc-pascal
On 07/11/2021 05:26, Ryan Joseph via fpc-pascal wrote: Is there anyway a function parameter could be inlined in FPC? This would go a long way in helping to parameterize functions that have tight loops in them. It's theoretically possible through constant propagation. If there isn't I wonder

[fpc-pascal] Inline function parameters

2021-11-06 Thread Ryan Joseph via fpc-pascal
Is there anyway a function parameter could be inlined in FPC? This would go a long way in helping to parameterize functions that have tight loops in them. If there isn't I wonder if this is an area where the proposed "pure" function modifier could be used to make it possible. ===