def-tool: Hoist loop invariant

This commit hoists loop invariant (collect_symbols()) out of the loop.

Test: ./tests/run.py
Change-Id: I865fb1a2da96d1fdecd3689795d6c46e42d4783c
1 file changed