Variable arguments with file and line information?

Dmitry Olshansky dmitry.olsh at gmail.com
Sun Nov 17 04:49:11 PST 2013


17-Nov-2013 16:36, Jonathan M Davis пишет:
> On Sunday, November 17, 2013 13:06:11 Chris Nicholson-Sauls wrote:
>> Something I'm wondering: if one were to split the implementation
>> along these lines:
>>
>>
>> void error (string file = __FILE__, size_t line = __LINE__,
>> Args...) (string msg, Args args) {
>>       errorImpl(file, line, msg, args);
>> }
>>
>> void errorImpl (Args...) (string file, size_t line, string msg,
>> Args args) {...}
>>
>>
>> What are the chances of the middle-man function being inlined,
>> thus cutting down on template bloat in the final product?  I
>> should hope it would be practically guaranteed.
>
> Without using -inline, the odds are zero. With the -inline... maybe. To be
> honest, dmd's inliner is horrible. e.g. it completely fails to inline any of
> std.ascii right now even though almost everything in there is a one line
> function.

At least we should fix this embarrassing limitation that kills  inlining 
of std.ascii on ALL compilers.

https://d.puremagic.com/issues/show_bug.cgi?id=10985

And it's not only std.ascii pretty much all non-templated stuff.

> We really, really need to improve the inliner.

Amen.

-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list