Make dialect const& and allocate single instances statically.

This commit is contained in:
chriseth
2019-05-17 12:54:24 +02:00
parent 570db164c9
commit 4bdb981224
28 changed files with 190 additions and 184 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ using namespace yul;
namespace
{
shared_ptr<Dialect const> defaultDialect(bool _yul)
Dialect const& defaultDialect(bool _yul)
{
return _yul ? yul::Dialect::yul() : yul::EVMDialect::strictAssemblyForEVM(dev::test::Options::get().evmVersion());
}
@@ -75,7 +75,7 @@ pair<shared_ptr<Block>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(strin
yul::Block yul::test::disambiguate(string const& _source, bool _yul)
{
auto result = parse(_source, _yul);
return boost::get<Block>(Disambiguator(*defaultDialect(_yul), *result.second, {})(*result.first));
return boost::get<Block>(Disambiguator(defaultDialect(_yul), *result.second, {})(*result.first));
}
string yul::test::format(string const& _source, bool _yul)