flatten: make hygienic.
authorwhitequark <whitequark@whitequark.org>
Thu, 4 Jun 2020 10:13:48 +0000 (10:13 +0000)
committerwhitequark <whitequark@whitequark.org>
Mon, 8 Jun 2020 19:30:21 +0000 (19:30 +0000)
commita1814b732fde79a84e7234d01faa53e80cc7568b
treef26519ebe2d19432b8325c40e9ea85c9bba2b621
parent4ef9ee3c4210a9d0c3b6491a0c89ee3365c77779
flatten: make hygienic.

Before this commit, `flatten` matched the template objects with
the newly created objects solely by their name. Because of this,
it could be confused by code such as:

    module bar();
      $dff a();
    endmodule

    module foo();
      bar b();
      $dff \b.a ();
    endmodule

After this commit, `flatten` avoids every possible case of name
collision.

Fixes #2106.
passes/techmap/flatten.cc