DIP56 Provide pragma to control function inlining

Vladimir Panteleev vladimir at thecybershadow.net
Sun Feb 23 05:01:13 PST 2014


On Sunday, 23 February 2014 at 12:57:00 UTC, Walter Bright wrote:
> On 2/23/2014 4:25 AM, Tove wrote:
>> The DIP should probably specify what happens if inlining fails,
>> i.e. generate a compilation error.
>
> I suspect that may cause problems, because different compilers 
> will have different inlining capabilities. I think it should be 
> a 'recommendation' to the compiler.

I think there should be some way to force the compiler to inline 
a function. As a bonus, the error message can tell the programmer 
why the function could not be inlined, allowing them to make the 
necessary adjustments.

Different compilers will have different inlining capabilities, 
however at the point where programmers are forcing inlining on or 
off, they are already micro-optimizing at a level which implies 
dependency on particular compiler implementations.


More information about the Digitalmars-d mailing list