Can someone please explain -allinst?

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Nov 22 00:50:57 PST 2013


22-Nov-2013 03:25, Jesse Phillips пишет:
> On Thursday, 21 November 2013 at 21:20:59 UTC, Gary Willoughby wrote:
>> Can someone explain the -allinst compiler flag for me please? I've
>> absolutely no idea what this flag does or when to use it.
>
> I don't think I have have an understanding of it, but here is what I
> think I had read. If I'm right, please say so. If not again, say so and
> ignore me.
>
> -allinst causes the compiler to preform the same behavior as prior to
> 2.064. What was that behavior? When building the program all the called
> templates would get instantiated (those in the library used and the
> other program files). What changed (again my interpretation of a quick
> read) was that the library will include the instances of the template
> used in the library. When generating the program the code for the
> templates where expected to exist in the library so that it doesn't have
> to instantiate them again. I suspect this leads to expecting instances
> which haven't actually been used to exist in the library, so you use the
> flag -allinst to force the compiler to build all the instances being used.

Something like that, plus compiler now tries not to generate instances 
that are only used in C-T checks (static ifs etc.). Something in this 
logic is currently broken or implementation is lacking, hence the 
workaround switch.

-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list