diff options
author | chriseth <chris@ethereum.org> | 2018-12-21 00:22:17 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2019-01-08 00:23:38 +0800 |
commit | 5b73c2ae3bce09442572b5401a7bcccc2ffe7590 (patch) | |
tree | d2e5b07ef78f240b3b8d1ae72cfae4054ce6e41e /libyul/backends | |
parent | 9f5d34af7de481c5b8ce89057a6df2a3283d14b0 (diff) | |
download | dexon-solidity-5b73c2ae3bce09442572b5401a7bcccc2ffe7590.tar.gz dexon-solidity-5b73c2ae3bce09442572b5401a7bcccc2ffe7590.tar.zst dexon-solidity-5b73c2ae3bce09442572b5401a7bcccc2ffe7590.zip |
Take special functions that require literals into account.
Diffstat (limited to 'libyul/backends')
-rw-r--r-- | libyul/backends/evm/EVMDialect.cpp | 8 | ||||
-rw-r--r-- | libyul/backends/evm/EVMDialect.h | 1 |
2 files changed, 6 insertions, 3 deletions
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<void()> @@ -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<void()> @@ -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<void()> _visitArguments @@ -128,6 +128,7 @@ void EVMDialect::addFunction( size_t _params, size_t _returns, bool _movable, + bool _literalArguments, std::function<void(FunctionCall const&, AbstractAssembly&, std::function<void()>)> _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); } diff --git a/libyul/backends/evm/EVMDialect.h b/libyul/backends/evm/EVMDialect.h index feb00b03..c23833bc 100644 --- a/libyul/backends/evm/EVMDialect.h +++ b/libyul/backends/evm/EVMDialect.h @@ -72,6 +72,7 @@ private: size_t _params, size_t _returns, bool _movable, + bool _literalArguments, std::function<void(FunctionCall const&, AbstractAssembly&, std::function<void()>)> _generateCode ); |