mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Reorganize so that warningPass is always set at least once when constfold is set.
This commit is contained in:
parent
8a8e255239
commit
f8a6d3d86c
1 changed files with 8 additions and 7 deletions
|
@ -81,14 +81,15 @@ class optimizer(foldconst, renamer, deadcode):
|
|||
|
||||
self.globalmode = False
|
||||
|
||||
if self.dcr:
|
||||
if self.constfold:
|
||||
self.FoldScript(warningpass=False)
|
||||
|
||||
if self.dcr:
|
||||
self.RemoveDeadCode()
|
||||
|
||||
# Make another fold pass, since RemoveDeadCode can embed expressions
|
||||
# into other expressions and generate unoptimized code.
|
||||
# Or make the first pass here if DCR is disabled.
|
||||
if self.constfold:
|
||||
self.FoldScript(warningpass=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue