diff options
author | David Shah <dave@ds0.me> | 2019-09-11 09:57:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-11 09:57:30 +0100 |
commit | c7f1368cd273f1d84507d29548f3420a08a82702 (patch) | |
tree | e309451ee79c7329dc87457bdc08debfcd9bd8ab /passes/opt/opt_share.cc | |
parent | 486cbddd26a8db5bb2f2bbe3ea15e36b6c53a55e (diff) | |
parent | 702ce405c18c2c28e7f5d354451141d8f16a4085 (diff) | |
download | yosys-c7f1368cd273f1d84507d29548f3420a08a82702.tar.gz yosys-c7f1368cd273f1d84507d29548f3420a08a82702.tar.bz2 yosys-c7f1368cd273f1d84507d29548f3420a08a82702.zip |
Merge pull request #1362 from xobs/smtbmc-msvc2-build-fixes
MSVC2 fixes
Diffstat (limited to 'passes/opt/opt_share.cc')
-rw-r--r-- | passes/opt/opt_share.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/passes/opt/opt_share.cc b/passes/opt/opt_share.cc index c53fb3113..2c456705c 100644 --- a/passes/opt/opt_share.cc +++ b/passes/opt/opt_share.cc @@ -108,12 +108,13 @@ bool cell_supported(RTLIL::Cell *cell) return false; } -std::map<IdString, IdString> mergeable_type_map{ - {ID($sub), ID($add)}, -}; +std::map<IdString, IdString> mergeable_type_map; bool mergeable(RTLIL::Cell *a, RTLIL::Cell *b) { + if (mergeable_type_map.empty()) { + mergeable_type_map.insert({ID($sub), ID($add)}); + } auto a_type = a->type; if (mergeable_type_map.count(a_type)) a_type = mergeable_type_map.at(a_type); |