force inline/not-inline

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 29 12:03:57 PDT 2015


On 29 July 2015 at 20:34, David Nadlinger via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Tuesday, 28 July 2015 at 23:55:00 UTC, Brandon Ragland wrote:
>
>> On Tuesday, 28 July 2015 at 21:28:30 UTC, Steven Schveighoffer wrote:
>>
>>> On 7/28/15 5:24 PM, David Nadlinger wrote:
>>>
>>>> […]
>>>>
>>>> pragma(inline);
>>>> pragma(inline, true);
>>>> pragma(inline, false);
>>>>
>>>> There is no way to represent those as a single boolean.
>>>>
>>>
>>> Ugh. And pragma(inline) doesn't mean what you would think it means. This
>>> is not a very good API for it, it's going to confuse everyone.
>>>
>>> -Steve
>>>
>>
>> I don't think it's terrible confusing, just deceptive.
>>
>> If pragma(inline) means "attempt to inline just like the -inline compile
>> time attribute" then it's just an ugly way of repeating yourself.
>>
>
> Unless I misread the source, it does not mean that at all. Instead, it
> leads to the same behavior as if no pragma(inline) was specified at all,
> i.e. use the normal heuristics if -inline is specified, and do not do any
> inlining otherwise.
>
>  — David
>
>
Of course, team sanity will do something different... Won't we? :o)

Well, for me it seems more obvious to let the GCC backend warn against any
functions that were marked pragma(inline) by the user, but will never be
inlined for one reason or another.

Regards
Iain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150729/2b4e930f/attachment.html>


More information about the Digitalmars-d mailing list