View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0038114||FPC||Compiler||public||2020-11-22 13:05||2020-11-22 13:28|
|Summary||0038114: Inlining cast managed typed to unmanaged|
|Description||Currently, the compiler can not inline calling functions like Test2, and it needs to make separate variants for each param to enable inlining.|
function Test1(A: PChar): PChar; inline;
Result := A + 1;
S := 'Test';
P := Pointer(S); //Inlined
P := Test1(P);
P := Test1(Pointer(S)); //Not inlined
|Tags||No tags attached.|
|Fixed in Revision|
There is no need to file bug reports about such cases. The default is "inline if the inline modifier is used", and then there are a bunch of cases that are excluded because the compiler currently cannot handle them.
I wanted something to monitor so when it is fixed; it can be possible to clean the code from many useless variants like the Test1 case.
Otherwise, it will be needed to check once in a while that if the compiler inlines this or not.