passes: opt_share: don't statically initialize mergeable_type_map
authorSean Cross <sean@xobs.io>
Mon, 9 Sep 2019 04:40:01 +0000 (12:40 +0800)
committerSean Cross <sean@xobs.io>
Mon, 9 Sep 2019 04:40:01 +0000 (12:40 +0800)
commit8d128ba6d079fd5f0741c31a9308bf06aaf4673c
treeac073ba260ffa5be96a5ee2a4904f3b76dc8c0c0
parent417f3fe6b19a0ed36cabe526fe3c67214b32971d
passes: opt_share: don't statically initialize mergeable_type_map

In 3d3779b0376b8204ed7637053176a07b7271ac1d this got turned from a
`std::map<std::string, std::string>` to `std::map<IdString, IdString>`.
Consequently, this exposed some initialization sequencing issues (#1361).

Only initialize the map when it's first used, to avoid these static issues.

This fixes #1361.

Signed-off-by: Sean Cross <sean@xobs.io>
passes/opt/opt_share.cc