clash-lang / clash-compiler

Haskell to VHDL/Verilog/SystemVerilog compiler
https://clash-lang.org/
Other
1.4k stars 149 forks source link

Stop duplicating binders in loadLocalModule #2564

Closed leonschoorl closed 11 months ago

leonschoorl commented 11 months ago

Since the refactor in c8f2bbdc1147be678c6cbda3832aec7f01a96be0 loadLocalModule was duplicating all (top level) binders contained in local modules. Because loadExternalExprs already puts all binders in loaded0.

This led to duplicate PrimGuard warnings like seen in #2561 and possibly more duplicate work elsewhere.

Fixes #2561

Still TODO: