pragma(inline, true) not very useful in its current state?
Marco Leise via Digitalmars-d
digitalmars-d at puremagic.com
Sat Sep 26 09:42:03 PDT 2015
Am Sat, 26 Sep 2015 12:21:15 +0200
schrieb Jacob Carlborg <doob at me.com>:
> On 2015-09-26 06:27, Manu via Digitalmars-d wrote:
>
> > We _really_ need attribute aliasing in
> > some form, especially since LDC/GDC have compiler-specific attributes
> > that DMD doesn't recognise.
>
> I'm not sure how much this helps but can't you use a dummy UDA on DMD
> for the GDC/LDC attributes?
pragma(inline, true) void foo() @gcc.attribute.attribute("forceinline") @ldc.attribute.attribute("alwaysinline") @safe pure nothrow @nogc
{
// Ok, what did I want this to do again ... ?
}
Maybe the compiler devs can decide on more common syntax like
a generic core.attribute or just use pragma for inlining, but
extend it so that it offers more options:
* no
* force
* flatten
(And maybe an additional 'allow' that convinces the compiler
that inlining is safe.)
--
Marco
More information about the Digitalmars-d
mailing list