diff options
author | chriseth <chris@ethereum.org> | 2018-02-06 19:20:00 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-02-07 05:51:30 +0800 |
commit | c961a3079dda8735363872cdb84c489d61846003 (patch) | |
tree | 8048fd3fbdd4f14031255344bfa1375a18d83e0f /libevmasm/SimplificationRules.h | |
parent | 5523296eaa68a591a331d9b75dc19cf11d1c538e (diff) | |
download | dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar.gz dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar.zst dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.zip |
Turn simplification rule tuple into struct.
Diffstat (limited to 'libevmasm/SimplificationRules.h')
-rw-r--r-- | libevmasm/SimplificationRules.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libevmasm/SimplificationRules.h b/libevmasm/SimplificationRules.h index 6040fd76..53f7e595 100644 --- a/libevmasm/SimplificationRules.h +++ b/libevmasm/SimplificationRules.h @@ -24,6 +24,7 @@ #pragma once #include <libevmasm/ExpressionClasses.h> +#include <libevmasm/SimplificationRule.h> #include <functional> #include <vector> @@ -47,21 +48,21 @@ public: /// @returns a pointer to the first matching pattern and sets the match /// groups accordingly. - std::tuple<Pattern, std::function<Pattern()>, bool> const* findFirstMatch( + SimplificationRule<Pattern> const* findFirstMatch( Expression const& _expr, ExpressionClasses const& _classes ); private: - void addRules(std::vector<std::tuple<Pattern, std::function<Pattern()>, bool>> const& _rules); - void addRule(std::tuple<Pattern, std::function<Pattern()>, bool> const& _rule); + void addRules(std::vector<SimplificationRule<Pattern>> const& _rules); + void addRule(SimplificationRule<Pattern> const& _rule); void resetMatchGroups() { m_matchGroups.clear(); } std::map<unsigned, Expression const*> m_matchGroups; /// Pattern to match, replacement to be applied and flag indicating whether /// the replacement might remove some elements (except constants). - std::vector<std::tuple<Pattern, std::function<Pattern()>, bool>> m_rules[256]; + std::vector<SimplificationRule<Pattern>> m_rules[256]; }; /** |