Will the new version of DCE allow to remove some p...
# javascript
g
Will the new version of DCE allow to remove some portion of code depending on a boolean value? It could be interesting to have some debug/logging code but with no performance or code size impact in production. @bashor?
1
t
In IR it can be realized by custom compiler plugin
g
Yes, but it also makes sense to be part of the DCE:
Copy code
if (false) {/* Dead code => remove */}
b
Yes, we are going to implement something like that, but not before we make IR BE default.
👍 1
👏 1
You can star or vote for KT-34912 to get updates.
(I think it should be a separate pass)
Also, we are thinking about the ability to provide some value externally. At least, it could be useful to able to distinguish debug/development and release/production builds, even we will not have a general solution.
👌 1
It would definitively make sense to generate different variants of builds.
b
more or less