[fpc-devel] "inline" issue

Sven Barth pascaldragon at googlemail.com
Fri Apr 26 23:20:32 CEST 2019


Am 26.04.2019 um 22:41 schrieb J. Gareth Moreton:
>
> On 26/04/2019 21:29, Sven Barth via fpc-devel wrote:
>> ...
>> You did read what Jonas said in the bug report? Adding "inline" in 
>> the implementation section for the interface section would need to 
>> lead to a change of the interface CRC which is a no-go once the 
>> interface section has been handled (and has lead to enough problems 
>> in the past, so fixing this remaining problem is definitely 
>> important). If another unit should inline something then the "inline" 
>> directive needs to be in the interface section, because that's the 
>> purpose of the interface section.
>
> I did.  I did talk with Jonas privately about the issue, because I did 
> try to fix the compiler so you couldn't do this.  The problem is, a 
> lot of stuff broke, including code in the System unit and the compiler 
> itself.  Take a look: https://bugs.freepascal.org/view.php?id=35433
There are two different points:
- for methods of classes/records/objects the "inline" directive must 
either be in the interface section or not be used at all
- for normal routines "inline" might appear only in the implementation 
section, but then it can be inlined *only* inside the same unit; for 
other units the routine would appear as if it had no "inline" directive

Thus only those cases where a method has "inline" in its implementation 
must be fixed (this will then have to be mentioned on the User Changes 
Trunk wiki page), for the global routines these *can* be fixed to 
improve inlining again. But they won't break compilation.

Regards,
Sven



More information about the fpc-devel mailing list