Reasoning based optimizer.

This commit is contained in:
chriseth
2020-09-15 15:57:58 +02:00
parent 5355e85639
commit f73fb726af
23 changed files with 825 additions and 6 deletions
+9
View File
@@ -33,6 +33,15 @@ Literal Dialect::zeroLiteralForType(solidity::yul::YulString _type) const
return {SourceLocation{}, LiteralKind::Number, "0"_yulstring, _type};
}
Literal Dialect::trueLiteral() const
{
if (boolType != defaultType)
return {SourceLocation{}, LiteralKind::Boolean, "true"_yulstring, boolType};
else
return {SourceLocation{}, LiteralKind::Number, "1"_yulstring, defaultType};
}
bool Dialect::validTypeForLiteral(LiteralKind _kind, YulString, YulString _type) const
{
if (_kind == LiteralKind::Boolean)