Reorganize so that warningPass is always set at least once when constfold is set.

This commit is contained in:
Sei Lisa 2015-08-19 05:41:21 +02:00
parent 8a8e255239
commit f8a6d3d86c

View file

@ -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)