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 /libjulia/optimiser/SimplificationRules.h | |
parent | 5523296eaa68a591a331d9b75dc19cf11d1c538e (diff) | |
download | dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar.gz dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar.bz2 dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar.lz dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar.xz dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.tar.zst dexon-solidity-c961a3079dda8735363872cdb84c489d61846003.zip |
Turn simplification rule tuple into struct.
Diffstat (limited to 'libjulia/optimiser/SimplificationRules.h')
-rw-r--r-- | libjulia/optimiser/SimplificationRules.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libjulia/optimiser/SimplificationRules.h b/libjulia/optimiser/SimplificationRules.h index 96f3de21..68b640b1 100644 --- a/libjulia/optimiser/SimplificationRules.h +++ b/libjulia/optimiser/SimplificationRules.h @@ -21,6 +21,7 @@ #pragma once #include <libevmasm/ExpressionClasses.h> +#include <libevmasm/SimplificationRule.h> #include <libjulia/ASTDataForward.h> @@ -48,16 +49,16 @@ public: /// @returns a pointer to the first matching pattern and sets the match /// groups accordingly. - static std::tuple<Pattern, std::function<Pattern()>, bool> const* findFirstMatch(Expression const& _expr); + static SimplificationRule<Pattern> const* findFirstMatch(Expression const& _expr); 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; - std::vector<std::tuple<Pattern, std::function<Pattern()>, bool>> m_rules[256]; + std::vector<SimplificationRule<Pattern>> m_rules[256]; }; enum class PatternKind |