diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-12-04 00:19:37 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-12-07 01:37:35 +0800 |
commit | 1eb60cbb3952df395df79ca1737f41708a658d4b (patch) | |
tree | 7c48065a0c5f14cac3f22559f5d91544020de859 /libyul/optimiser/SimplificationRules.cpp | |
parent | 4b2a64306a6b85407210245a47a7df1e0a5e0cbf (diff) | |
download | dexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.tar.gz dexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.tar.zst dexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.zip |
Add structural simplifier as optimization step for Yul.
Diffstat (limited to 'libyul/optimiser/SimplificationRules.cpp')
-rw-r--r-- | libyul/optimiser/SimplificationRules.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libyul/optimiser/SimplificationRules.cpp b/libyul/optimiser/SimplificationRules.cpp index 8ed63fa8..45b0ca2c 100644 --- a/libyul/optimiser/SimplificationRules.cpp +++ b/libyul/optimiser/SimplificationRules.cpp @@ -208,10 +208,7 @@ Expression Pattern::toExpression(SourceLocation const& _location) const u256 Pattern::d() const { - Literal const& literal = boost::get<Literal>(matchGroupValue()); - assertThrow(literal.kind == LiteralKind::Number, OptimizerException, ""); - assertThrow(isValidDecimal(literal.value.str()) || isValidHex(literal.value.str()), OptimizerException, ""); - return u256(literal.value.str()); + return valueOfNumberLiteral(boost::get<Literal>(matchGroupValue())); } Expression const& Pattern::matchGroupValue() const |