Only provide code generator to CodeTransform.

This commit is contained in:
chriseth
2021-08-04 18:38:10 +02:00
parent 2d5b9036c2
commit 467cbf92bc
6 changed files with 22 additions and 26 deletions
+1 -1
View File
@@ -520,7 +520,7 @@ void CompilerContext::appendInlineAssembly(
analysisInfo,
*m_asm,
m_evmVersion,
identifierAccess,
identifierAccess.generateCode,
_system,
_optimiserSettings.optimizeStackAllocation
);
+6 -10
View File
@@ -702,15 +702,11 @@ bool ContractCompiler::visit(FunctionDefinition const& _function)
bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
{
unsigned startStackHeight = m_context.stackHeight();
yul::ExternalIdentifierAccess identifierAccess;
identifierAccess.resolve = [&](yul::Identifier const& _identifier, yul::IdentifierContext, bool)
{
auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier);
if (ref == _inlineAssembly.annotation().externalReferences.end())
return numeric_limits<size_t>::max();
return ref->second.valueSize;
};
identifierAccess.generateCode = [&](yul::Identifier const& _identifier, yul::IdentifierContext _context, yul::AbstractAssembly& _assembly)
yul::ExternalIdentifierAccess::CodeGenerator identifierAccessCodeGen = [&](
yul::Identifier const& _identifier,
yul::IdentifierContext _context,
yul::AbstractAssembly& _assembly
)
{
auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier);
solAssert(ref != _inlineAssembly.annotation().externalReferences.end(), "");
@@ -918,7 +914,7 @@ bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
*analysisInfo,
*m_context.assemblyPtr(),
m_context.evmVersion(),
identifierAccess,
identifierAccessCodeGen,
false,
m_optimiserSettings.optimizeStackAllocation
);