Am Wed, 26 Nov 2014 01:44:02 +1100 schrieb "Daniel Murphy" <[email protected]>:
> "Johannes Pfau" wrote in message > news:[email protected]... > > > 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.
