DIP56 Provide pragma to control function inlining

dennis luehring dl.soluz at gmx.net
Sun Feb 23 05:03:42 PST 2014


Am 23.02.2014 13:38, schrieb Dmitry Olshansky:
> 23-Feb-2014 16:07, Walter Bright пОшет:
>> http://wiki.dlang.org/DIP56
>>
>> Manu has needed always inlining, and I've needed never inlining. This
>> DIP proposes a simple solution.
>
> Why pragma? Also how exactly it is supposed to work:
>
> pragma(inline, true);
> ... //every declaration that follows is forcibly inlined?
> pragma(inline, false);
> ... //every declaration that follows is forcibly NOT inlined?
>
> How to return to normal state then? I think pragma is not attached to
> declaration.
>
> I'd strongly favor introducing a compiler-hint family of UDAs and
> force_inline/force_notinline as first among many.

yea it feels strange - like naked in inline asm
its a scope changer - that sits inside the scope it changes???

like writing public methods by putting public inside of the method - and 
public is also compiler relevant for the generated interface

and aligne is also not a pragma - and still changes codegeneration

its a function-(compile-)attribute but that does not mean it have to
be a pragma

btw: is the pragma way just easier to implement - or else i don't 
understand why this is handle so special?



More information about the Digitalmars-d mailing list