mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
parent
c3bb056f05
commit
42f47d38f0
3 changed files with 18 additions and 9 deletions
|
@ -322,13 +322,18 @@ class deadcode(object):
|
|||
node = sym['W']
|
||||
nt = node.nt
|
||||
|
||||
while nt == 'IDENT':
|
||||
# Follow the chain of identifiers all the way to the original
|
||||
if self.symtab[node.scope][node.name].get('W', False) is False:
|
||||
return sym
|
||||
sym = self.symtab[node.scope][node.name]
|
||||
node = sym['W']
|
||||
nt = node.nt
|
||||
# This screws up swaps. See
|
||||
# unit_tests/regression.suite/aggressive-local-removal.lsl
|
||||
# It can't be done without a reliable CFG-based method (SSA or
|
||||
# the like).
|
||||
|
||||
# while nt == 'IDENT':
|
||||
# # Follow the chain of identifiers all the way to the original
|
||||
# if self.symtab[node.scope][node.name].get('W', False) is False:
|
||||
# return sym
|
||||
# sym = self.symtab[node.scope][node.name]
|
||||
# node = sym['W']
|
||||
# nt = node.nt
|
||||
|
||||
if nt == 'CONST':
|
||||
tcurnode = curnode.t
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue