February 25, 2014 Re: DIP56 Provide pragma to control function inlining | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jerry | On Monday, 24 February 2014 at 22:09:49 UTC, Jerry wrote:
> Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> writes:
>
>> On 2/23/14, 8:26 PM, Vladimir Panteleev wrote:
>>> Thus, I think there should be "try to inline" (same as -inline) and
>>> "always inline" (failure stops compilation).
>>
>> Sounds fair enough.
>
> pragma(inline, false);
> pragma(inline, true);
> pragma(inline, force); // inline or die
>
> How is that?
Personally I like it. Perhaps you forgot
pragma(inline, never); // don't inline or die
but I honestly have no idea if this would actually be useful.
Anyway, I'm really fine if there will be no way to force inline. But if we can't guarantee that inlining actually happens, please change the pragma name.
|
Copyright © 1999-2021 by the D Language Foundation