Dead Code Elimination

user1234 user1234 at 12.de
Wed Oct 21 17:05:24 UTC 2026


On Wednesday, 21 October 2026 at 14:59:20 UTC, Paolo Invernizzi 
wrote:
> On Wednesday, 21 October 2026 at 09:32:25 UTC, user1234 wrote:
>> On Sunday, 18 October 2026 at 15:33:17 UTC, libxmoc wrote:
>>> I noticed that dmd doesn't do DCE, my executable is quite 
>>> large for what it does. Any plan to add that? I tried to do 
>>> it myself, a simple bool in DSymbol + a visitor (yoinked it 
>>> from the unused import PR) to scan things, and it shrank 
>>> build time by ~15% and executable went down to 3.5mb from 
>>> 5.5mb.
>>>
>>> Surely someone smarter than me could do even better.
>>
>> It's hard to say when something is used, simple example:
>> [...]
>
> Not an answer on the compiler side, but related, since today 
> djs-vscode (0.2.0) shows unused code in the editor.
>
> [...]
> Paolo

I see what you mean. One thing however: you can forgive an error 
from your your code editor. But an error in the backend 
production will be way more frustrating.

I have nothing against the idea of libxmoc, I wanted to note that 
this should be made with care. Maybe in a first time this could 
be tried with a compiler warning.


More information about the Digitalmars-d mailing list