[Issue 11284] add -allinst compiler switch

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 18 05:52:32 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11284


Dicebot <public at dicebot.lv> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |public at dicebot.lv


--- Comment #2 from Dicebot <public at dicebot.lv> 2013-10-18 05:52:29 PDT ---
(In reply to comment #1)
> It makes sense, but in this particular case: Why is foo!double put into a.obj
> in the first place, when it is only used in CTFE? From reading the NG, it seems
> there are a lot of unnecessary templates instantiated, for things like template
> constraints. 
> 
> Best regards,
> Robert

There are 2 reasons for this.

First, related part of DMD source code is damn complicated. I have wasted
several months trying to figure this out and when Walter came out with his own
partial solution I was hardly even able to understand reasoning behind those
exact changes.

But probably I am just stupid. Second issue is much more important though:

Currently D spec does not allow any symbol visibility optimizations. The fact
that symbol X is used only during CTFE during compilation of module A does not
mean it won't be used in runtime from module B. Or even linked dynamically. Any
really clever stuff can be done here only after specification is restricted.

I have had a proposal for internal linkage attribute ages ago which is tightly
related but I am not skilled enough to implement it right now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list