[fpc-pascal] inlining functions

Benito van der Zander benito at benibela.de
Sat Jan 12 17:36:30 CET 2019


  something that appears  to help is to put units in the interface uses 
rather than the implementation uses.

When the unit mentioned in the interface uses, uses the first unit in 
its implementation uses, it can inline the functions from the first 
unit. Although I would have expected it to do the opposite.

Unfortunately that does not help if the second unit needs to use types 
from the first unit in its interface


Am 12.01.19 um 13:05 schrieb denisgolovan:
> 12.01.2019, 14:53, "Jonas Maebe" <jonas at freepascal.org>:
>> Not at this time (unless you use the LLVM backend).
> Could you give some hints on how to enable WPO/LTO under LLVM backend?
> http://wiki.freepascal.org/LLVM does not seem to mention anything on that.
>> However, what you actually can do, is manually recompile all units of your program
>> multiple times. While this won't help with inline functions called
>> before they are parsed in those same units, it will allow inlining of
>> function bodies in other units that were not available during the first
>> compilation due to dependency cycles.
> Eh.
> It does not look too practical, right?
> Unless there is some magical receipt for that :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190112/3d918bd4/attachment.html>

More information about the fpc-pascal mailing list