Reorganize so that warningPass is always set at least once when constfold is set.
This commit is contained in:
@@ -81,16 +81,17 @@ class optimizer(foldconst, renamer, deadcode):
|
|||||||
|
|
||||||
self.globalmode = False
|
self.globalmode = False
|
||||||
|
|
||||||
if self.constfold:
|
|
||||||
self.FoldScript(warningpass=False)
|
|
||||||
|
|
||||||
if self.dcr:
|
if self.dcr:
|
||||||
|
if self.constfold:
|
||||||
|
self.FoldScript(warningpass=False)
|
||||||
|
|
||||||
self.RemoveDeadCode()
|
self.RemoveDeadCode()
|
||||||
|
|
||||||
# Make another fold pass, since RemoveDeadCode can embed expressions
|
# Make another fold pass, since RemoveDeadCode can embed expressions
|
||||||
# into other expressions and generate unoptimized code.
|
# into other expressions and generate unoptimized code.
|
||||||
if self.constfold:
|
# Or make the first pass here if DCR is disabled.
|
||||||
self.FoldScript(warningpass=True)
|
if self.constfold:
|
||||||
|
self.FoldScript(warningpass=True)
|
||||||
|
|
||||||
if self.shrinknames:
|
if self.shrinknames:
|
||||||
self.ShrinkNames()
|
self.ShrinkNames()
|
||||||
|
|||||||
Reference in New Issue
Block a user