DMD hackers: pragma(address): Is this possible?

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 25 07:46:33 PST 2014


Am Wed, 26 Nov 2014 01:44:02 +1100
schrieb "Daniel Murphy" <yebbliesnospam at gmail.com>:

> "Johannes Pfau"  wrote in message
> news:m522gv$1rav$1 at digitalmars.com...
> 
> > Good idea, this works and results in equal ASM. A minor drawback is
> > that this emits an additional function (even with always inline),
> > but that's a problem that also occurs in other contexts and I've
> > got a workaround for that.
> 
> Awesome.
> 
> > Inlining in GDC right now only works across modules when templates
> > are used. Templating the PORTB property doesn't work (PORTB()() is
> > not an lvalue when taking the address &PORTB).
> > So I'll probably have to implement cross-module inlining then.
> 
> Will it be cross-module inlined if it's an alias to a templated
> function instantation?

No, unfortunately not. The module where the template is instantiated
needs to be the 'main' module. Or rather toObjfile must have been
called on the function for backend inlining. Unfortunately this seems
to be a complicated task.


More information about the Digitalmars-d mailing list