aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorVoR0220 <catalanor0220@gmail.com>2016-03-30 04:08:51 +0800
committerVoR0220 <catalanor0220@gmail.com>2016-05-10 00:41:02 +0800
commit4b749fc33335cee2de50e31776ddae1f73649a7b (patch)
treea8f28bbb649a1f4e80845aaef5a9b34c2f6c4f05 /libsolidity/codegen/ExpressionCompiler.cpp
parent4d283b2b304f9c9a85fb6f03346cc7c9d0054daa (diff)
downloaddexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar.gz
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar.bz2
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar.lz
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar.xz
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar.zst
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.zip
changed names for Rational Constants and categories
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 14bc0855..baf587f0 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -285,7 +285,7 @@ bool ExpressionCompiler::visit(UnaryOperation const& _unaryOperation)
// the operator should know how to convert itself and to which types it applies, so
// put this code together with "Type::acceptsBinary/UnaryOperator" into a class that
// represents the operator
- if (_unaryOperation.annotation().type->category() == Type::Category::NumberConstant)
+ if (_unaryOperation.annotation().type->category() == Type::Category::RationalNumber)
{
m_context << _unaryOperation.annotation().type->literalValue(nullptr);
return false;
@@ -360,7 +360,7 @@ bool ExpressionCompiler::visit(BinaryOperation const& _binaryOperation)
if (c_op == Token::And || c_op == Token::Or) // special case: short-circuiting
appendAndOrOperatorCode(_binaryOperation);
- else if (commonType.category() == Type::Category::NumberConstant)
+ else if (commonType.category() == Type::Category::RationalNumber)
m_context << commonType.literalValue(nullptr);
else
{
@@ -370,7 +370,7 @@ bool ExpressionCompiler::visit(BinaryOperation const& _binaryOperation)
// for commutative operators, push the literal as late as possible to allow improved optimization
auto isLiteral = [](Expression const& _e)
{
- return dynamic_cast<Literal const*>(&_e) || _e.annotation().type->category() == Type::Category::NumberConstant;
+ return dynamic_cast<Literal const*>(&_e) || _e.annotation().type->category() == Type::Category::RationalNumber;
};
bool swap = m_optimize && Token::isCommutativeOp(c_op) && isLiteral(rightExpression) && !isLiteral(leftExpression);
if (swap)
@@ -1225,7 +1225,7 @@ void ExpressionCompiler::endVisit(Literal const& _literal)
switch (type->category())
{
- case Type::Category::NumberConstant:
+ case Type::Category::RationalNumber:
case Type::Category::Bool:
m_context << type->literalValue(&_literal);
break;