July 27, 2014
On Sunday, 27 July 2014 at 07:48:18 UTC, Marc Schütz wrote:
> On Sunday, 27 July 2014 at 07:01:52 UTC, Daniel Murphy wrote:
>> "Dicebot"  wrote in message news:xpjsskmamagclzoiwtxb@forum.dlang.org...
>>
>>> I can't PR but there were one by Kenji that did inline of such calls in the frontend providing 100% gurantee whatever backend is used.
>>
>> There is no 100% guarantee, the frontend's inliner is not capable of inlining the majority of function calls.  The only guarantee is that it will try to inline the lambda whether or not the -inline switch is used.
>
> Too bad... If it was guaranteed, there would then be a compiler independent way to force inlining. Is there a chance that the limits to inlining in DMD will ever be removed?

IIRC the core reason is that expression nodes in the AST cannot contain statements. Isn't it possible to create a "bridge" node type that is allowed to appear in expressions, but may also contain statements?
July 27, 2014
"Marc Schütz" " wrote in message news:gefktpkzfnlryljvwmqa@forum.dlang.org...

> IIRC the core reason is that expression nodes in the AST cannot contain statements. Isn't it possible to create a "bridge" node type that is allowed to appear in expressions, but may also contain statements?

Sure, but that would be horrible (from an implementation point of view). The better way is to use an ir/backend inliner, ie use gdc or ldc. 

July 28, 2014
On 7/27/14, 1:35 AM, Daniel Murphy wrote:
> "Marc Schütz" " wrote in message
> news:gefktpkzfnlryljvwmqa@forum.dlang.org...
>
>> IIRC the core reason is that expression nodes in the AST cannot
>> contain statements. Isn't it possible to create a "bridge" node type
>> that is allowed to appear in expressions, but may also contain
>> statements?
>
> Sure, but that would be horrible (from an implementation point of view).
> The better way is to use an ir/backend inliner, ie use gdc or ldc.

Ionno. There are a few high-level constructs in D that are amenable to front-end inlining - doing so in the backend entails quite a bit of assembling the cow back from the burger. -- Andrei
1 2
Next ›   Last »