mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding vardecl optimization for boolean types
This commit is contained in:
committed by
chriseth
parent
e75cace78d
commit
a52c9af5b9
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user