Adding vardecl optimization for boolean types

This commit is contained in:
Djordje Mijovic
2020-02-24 15:05:19 +01:00
committed by chriseth
parent e75cace78d
commit a52c9af5b9
7 changed files with 52 additions and 7 deletions
+8
View File
@@ -23,6 +23,14 @@
using namespace solidity::yul;
using namespace std;
using namespace solidity::langutil;
Literal Dialect::zeroLiteralForType(solidity::yul::YulString _type) const
{
if (_type == boolType && _type != defaultType)
return {SourceLocation{}, LiteralKind::Boolean, "false"_yulstring, _type};
return {SourceLocation{}, LiteralKind::Number, "0"_yulstring, _type};
}
bool Dialect::validTypeForLiteral(LiteralKind _kind, YulString, YulString _type) const
{