Closed mtijanic closed 5 months ago
Based on testing from Daz and Jasperre, I'm happy for this to go in and get some more testing.
Well, it ain't getting any more testing sitting in a PR, so this is the logical next step. Let it soak here a while and then pull into preview.
In a script like:
the generated code looks like:
and the parse tree is:
With this change, we detect this parse tree and trim it down to:
which results in the following NCS:
See comments in TrimParseTree() for details.
Testing
dead_branches.nss
test case. Verified withnwn_asm
that it removes dead branches, leaves ones that aren't entirely constant.if (DEBUG)
dead statementsChangelog
Performance Improvements
if
condition is a constantLicence