Assembly: Removing EVMDialect::looseAssemblyForEVM().

This commit is contained in:
Christian Parpart 2019-09-10 11:45:56 +02:00
parent fdbbf75e78
commit dc2adb3d9d
4 changed files with 3 additions and 13 deletions

View File

@ -328,7 +328,7 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly)
analysisInfo,
errorsIgnored,
errorTypeForLoose,
yul::EVMDialect::looseAssemblyForEVM(EVMVersion{}),
yul::EVMDialect::strictAssemblyForEVM(EVMVersion{}),
resolver
).analyze(_inlineAssembly.operations());
return false;

View File

@ -54,7 +54,7 @@ Dialect const& languageToDialect(AssemblyStack::Language _language, EVMVersion _
switch (_language)
{
case AssemblyStack::Language::Assembly:
return EVMDialect::looseAssemblyForEVM(_version);
return EVMDialect::strictAssemblyForEVM(_version);
case AssemblyStack::Language::StrictAssembly:
return EVMDialect::strictAssemblyForEVMObjects(_version);
case AssemblyStack::Language::Yul:
@ -135,7 +135,7 @@ void AssemblyStack::compileEVM(AbstractAssembly& _assembly, bool _evm15, bool _o
EVMDialect const* dialect = nullptr;
if (m_language == Language::Assembly)
dialect = &EVMDialect::looseAssemblyForEVM(m_evmVersion);
dialect = &EVMDialect::strictAssemblyForEVM(m_evmVersion);
else if (m_language == AssemblyStack::Language::StrictAssembly)
dialect = &EVMDialect::strictAssemblyForEVMObjects(m_evmVersion);
else if (m_language == AssemblyStack::Language::Yul)

View File

@ -185,15 +185,6 @@ BuiltinFunctionForEVM const* EVMDialect::builtin(YulString _name) const
return nullptr;
}
EVMDialect const& EVMDialect::looseAssemblyForEVM(langutil::EVMVersion _version)
{
static map<langutil::EVMVersion, unique_ptr<EVMDialect const>> dialects;
static YulStringRepository::ResetCallback callback{[&] { dialects.clear(); }};
if (!dialects[_version])
dialects[_version] = make_unique<EVMDialect>(AsmFlavour::Loose, false, _version);
return *dialects[_version];
}
EVMDialect const& EVMDialect::strictAssemblyForEVM(langutil::EVMVersion _version)
{
static map<langutil::EVMVersion, unique_ptr<EVMDialect const>> dialects;

View File

@ -72,7 +72,6 @@ struct EVMDialect: public Dialect
BuiltinFunctionForEVM const* equalityFunction() const override { return builtin("eq"_yulstring); }
BuiltinFunctionForEVM const* booleanNegationFunction() const override { return builtin("iszero"_yulstring); }
static EVMDialect const& looseAssemblyForEVM(langutil::EVMVersion _version);
static EVMDialect const& strictAssemblyForEVM(langutil::EVMVersion _version);
static EVMDialect const& strictAssemblyForEVMObjects(langutil::EVMVersion _version);
static EVMDialect const& yulForEVM(langutil::EVMVersion _version);