Collect used library functions as reusable names for the renamer.

Implements another TODO.

There was a TODO about a new counter per scope, but that makes no sense. The renamer only acts on global variables, global function and parameter names, state names, and event parameters. We're already restarting the counters at every function, which is the closest to what that TODO was about.
This commit is contained in:
Sei Lisa 2017-11-02 23:19:33 +01:00
parent 93828b9286
commit 1cdf9f7ff0
3 changed files with 22 additions and 12 deletions

View file

@ -90,10 +90,10 @@ class optimizer(foldconst, renamer, deadcode, lastpass):
if self.constfold:
self.FoldScript(warningpass=True)
self.LastPass()
names = self.LastPass()
if self.shrinknames:
self.ShrinkNames()
self.ShrinkNames(UsableAsParams = names['libfuncs'])
treesymtab = (self.tree, self.symtab)
del self.tree