forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgen: remove dead code (nim-lang#1051)
## Summary Remove an optimization/semantic-change from `cgen` that's not used anymore. ## Details The `isInactiveDestructorCall`/`notYetAlive` procedures was responsible for detecting whether a destructor call or reset operation could be safely omitted for a local. This is a workaround for destructor injection being limited to wrapping whole scopes in `try`/`finally` statements, but it finally stopped working with the introduction of the MIR (~11 months ago), as the 'def' statements for all locals requiring destruction are placed before the `try` statement responsible for their destruction. Since the proper fix will be implemented in the destructor injection pass rather than in the code generators, `isInactiveDestructorCall`, `notYetAlive` are removed and their usage sites are updated. The now- unused `compat.getRoot` procedure is removed too.
- Loading branch information
Showing
3 changed files
with
1 addition
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters