Mark returned constant node as side effect-free.
When a function was successfully applied, the resulting constant node was not marked as side effect-free. This could potentially lead to poor optimization.
This commit is contained in:
@@ -1000,7 +1000,7 @@ class foldconst(object):
|
|||||||
if self.warntabs:
|
if self.warntabs:
|
||||||
warning(u"Can't optimize call to %s because it would generate a tab character (you can force the optimization with the 'foldtabs' option, or disable this warning by disabling the 'warntabs' option)." % node['name'].decode('utf8'))
|
warning(u"Can't optimize call to %s because it would generate a tab character (you can force the optimization with the 'foldtabs' option, or disable this warning by disabling the 'warntabs' option)." % node['name'].decode('utf8'))
|
||||||
return
|
return
|
||||||
parent[index] = {'nt':'CONST', 't':node['t'], 'value':value}
|
parent[index] = {'nt':'CONST', 't':node['t'], 'value':value, 'SEF':True}
|
||||||
elif node['name'] == 'llGetListLength':
|
elif node['name'] == 'llGetListLength':
|
||||||
# Convert llGetListLength(expr) to (expr != [])
|
# Convert llGetListLength(expr) to (expr != [])
|
||||||
node = {'nt':'CONST', 't':'list', 'value':[]}
|
node = {'nt':'CONST', 't':'list', 'value':[]}
|
||||||
|
|||||||
Reference in New Issue
Block a user