mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6193 from ethereum/yul-opt-different-types-6181
YulOpt: Extend StructuralSimplifier to work with all types
This commit is contained in:
@@ -155,20 +155,7 @@ void ExpressionEvaluator::operator()(Literal const& _literal)
|
||||
static YulString const trueString("true");
|
||||
static YulString const falseString("false");
|
||||
|
||||
switch (_literal.kind)
|
||||
{
|
||||
case LiteralKind::Boolean:
|
||||
solAssert(_literal.value == trueString || _literal.value == falseString, "");
|
||||
setValue(_literal.value == trueString ? 1 : 0);
|
||||
break;
|
||||
case LiteralKind::Number:
|
||||
setValue(valueOfNumberLiteral(_literal));
|
||||
break;
|
||||
case LiteralKind::String:
|
||||
solAssert(_literal.value.str().size() <= 32, "");
|
||||
setValue(u256(h256(_literal.value.str(), h256::FromBinary, h256::AlignLeft)));
|
||||
break;
|
||||
}
|
||||
setValue(valueOfLiteral(_literal));
|
||||
}
|
||||
|
||||
void ExpressionEvaluator::operator()(Identifier const& _identifier)
|
||||
|
||||
Reference in New Issue
Block a user