From 5b73c2ae3bce09442572b5401a7bcccc2ffe7590 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 20 Dec 2018 17:22:17 +0100 Subject: Take special functions that require literals into account. --- libyul/backends/evm/EVMDialect.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libyul/backends/evm/EVMDialect.cpp') diff --git a/libyul/backends/evm/EVMDialect.cpp b/libyul/backends/evm/EVMDialect.cpp index 935f05c6..18502117 100644 --- a/libyul/backends/evm/EVMDialect.cpp +++ b/libyul/backends/evm/EVMDialect.cpp @@ -44,7 +44,7 @@ EVMDialect::EVMDialect(AsmFlavour _flavour, bool _objectAccess): if (!m_objectAccess) return; - addFunction("datasize", 1, 1, true, [this]( + addFunction("datasize", 1, 1, true, true, [this]( FunctionCall const& _call, AbstractAssembly& _assembly, std::function @@ -58,7 +58,7 @@ EVMDialect::EVMDialect(AsmFlavour _flavour, bool _objectAccess): else _assembly.appendDataSize(m_subIDs.at(dataName)); }); - addFunction("dataoffset", 1, 1, true, [this]( + addFunction("dataoffset", 1, 1, true, true, [this]( FunctionCall const& _call, AbstractAssembly& _assembly, std::function @@ -72,7 +72,7 @@ EVMDialect::EVMDialect(AsmFlavour _flavour, bool _objectAccess): else _assembly.appendDataOffset(m_subIDs.at(dataName)); }); - addFunction("datacopy", 3, 0, false, []( + addFunction("datacopy", 3, 0, false, false, []( FunctionCall const&, AbstractAssembly& _assembly, std::function _visitArguments @@ -128,6 +128,7 @@ void EVMDialect::addFunction( size_t _params, size_t _returns, bool _movable, + bool _literalArguments, std::function)> _generateCode ) { @@ -137,5 +138,6 @@ void EVMDialect::addFunction( f.parameters.resize(_params); f.returns.resize(_returns); f.movable = _movable; + f.literalArguments = _literalArguments; f.generateCode = std::move(_generateCode); } -- cgit