diff options
author | liangdzou <liang.d.zou@gmail.com> | 2018-09-25 10:47:25 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-12-10 21:28:56 +0800 |
commit | 362648a45042d74da4e631520c0be581902c871b (patch) | |
tree | a7f9d5df94b4d9ac8cbbc89e99c6d74d8d080732 /libyul/optimiser | |
parent | 6240d9e72a6f1696d7c37facf805af6ce2352ab2 (diff) | |
download | dexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar.gz dexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar.zst dexon-solidity-362648a45042d74da4e631520c0be581902c871b.zip |
Reuse stack slots in Yul to EVM code generation.
Diffstat (limited to 'libyul/optimiser')
-rw-r--r-- | libyul/optimiser/ASTWalker.cpp | 20 | ||||
-rw-r--r-- | libyul/optimiser/ASTWalker.h | 20 |
2 files changed, 24 insertions, 16 deletions
diff --git a/libyul/optimiser/ASTWalker.cpp b/libyul/optimiser/ASTWalker.cpp index 0d568007..6adcb2e1 100644 --- a/libyul/optimiser/ASTWalker.cpp +++ b/libyul/optimiser/ASTWalker.cpp @@ -93,6 +93,16 @@ void ASTWalker::operator()(Block const& _block) walkVector(_block.statements); } +void ASTWalker::visit(Statement const& _st) +{ + boost::apply_visitor(*this, _st); +} + +void ASTWalker::visit(Expression const& _e) +{ + boost::apply_visitor(*this, _e); +} + void ASTModifier::operator()(FunctionalInstruction& _instr) { walkVector(_instr.arguments | boost::adaptors::reversed); @@ -155,3 +165,13 @@ void ASTModifier::operator()(Block& _block) { walkVector(_block.statements); } + +void ASTModifier::visit(Statement& _st) +{ + boost::apply_visitor(*this, _st); +} + +void ASTModifier::visit(Expression& _e) +{ + boost::apply_visitor(*this, _e); +} diff --git a/libyul/optimiser/ASTWalker.h b/libyul/optimiser/ASTWalker.h index b59b405e..272725f9 100644 --- a/libyul/optimiser/ASTWalker.h +++ b/libyul/optimiser/ASTWalker.h @@ -58,14 +58,8 @@ public: virtual void operator()(ForLoop const&); virtual void operator()(Block const& _block); - virtual void visit(Statement const& _st) - { - boost::apply_visitor(*this, _st); - } - virtual void visit(Expression const& _e) - { - boost::apply_visitor(*this, _e); - } + virtual void visit(Statement const& _st); + virtual void visit(Expression const& _e); protected: template <class T> @@ -99,14 +93,8 @@ public: virtual void operator()(ForLoop&); virtual void operator()(Block& _block); - virtual void visit(Statement& _st) - { - boost::apply_visitor(*this, _st); - } - virtual void visit(Expression& _e) - { - boost::apply_visitor(*this, _e); - } + virtual void visit(Statement& _st); + virtual void visit(Expression& _e); protected: template <class T> |