mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Unary operation for literals.
This commit is contained in:
parent
8a3006a0fa
commit
4069b19734
@ -189,6 +189,16 @@ void IRGeneratorForStatements::endVisit(Return const& _return)
|
||||
m_code << "return_flag := 0\n" << "break\n";
|
||||
}
|
||||
|
||||
void IRGeneratorForStatements::endVisit(UnaryOperation const& _unaryOperation)
|
||||
{
|
||||
if (_unaryOperation.annotation().type->category() == Type::Category::RationalNumber)
|
||||
defineExpression(_unaryOperation) <<
|
||||
formatNumber(_unaryOperation.annotation().type->literalValue(nullptr)) <<
|
||||
"\n";
|
||||
else
|
||||
solUnimplementedAssert(false, "");
|
||||
}
|
||||
|
||||
void IRGeneratorForStatements::endVisit(BinaryOperation const& _binOp)
|
||||
{
|
||||
solAssert(!!_binOp.annotation().commonType, "");
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
bool visit(Continue const& _continueStatement) override;
|
||||
bool visit(Break const& _breakStatement) override;
|
||||
void endVisit(Return const& _return) override;
|
||||
void endVisit(UnaryOperation const& _unaryOperation) override;
|
||||
void endVisit(BinaryOperation const& _binOp) override;
|
||||
void endVisit(FunctionCall const& _funCall) override;
|
||||
bool visit(InlineAssembly const& _inlineAsm) override;
|
||||
|
Loading…
Reference in New Issue
Block a user