aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorRJ Catalano <rcatalano@macsales.com>2016-02-19 06:39:11 +0800
committerVoR0220 <catalanor0220@gmail.com>2016-05-10 00:41:02 +0800
commit9a075458ad104921c9d747cd34d3e5c299638406 (patch)
treec2005fb8b8032c54c7ab65196e952d01ab747327 /libsolidity/codegen/ExpressionCompiler.cpp
parent9e36bdda8a9552f1885e0a63a85db588623b39b2 (diff)
downloaddexon-solidity-9a075458ad104921c9d747cd34d3e5c299638406.tar
dexon-solidity-9a075458ad104921c9d747cd34d3e5c299638406.tar.gz
dexon-solidity-9a075458ad104921c9d747cd34d3e5c299638406.tar.bz2
dexon-solidity-9a075458ad104921c9d747cd34d3e5c299638406.tar.lz
dexon-solidity-9a075458ad104921c9d747cd34d3e5c299638406.tar.xz
dexon-solidity-9a075458ad104921c9d747cd34d3e5c299638406.tar.zst
dexon-solidity-9a075458ad104921c9d747cd34d3e5c299638406.zip
initial work for fixed types...potentially needing a constant literal type for this
notation Rational implemented...trying to figure out exponential fix for token bug, also quick fix for the wei and seconds fixed problem with var...probably a conversion problem for fixed in size capabilities adding fixed type tests Removing bitshift and regrouping fixed type tests together size capabilities functioning properly for fixed types got exponents up and working with their inverse, changed a few of the tests....something is working that likely shouldn't be slight changes to how to flip the rational negative around...still trying to figure it out tests added updated tests odd differences in trying soltest from solc binary, let me know if you can replicate test not working for odd reason fixed test problem with fixed literals...still need a way to log this error broken up the tests, added some, changed some things in types and began compiler work moar tests and prepping for rebuilding much of the types.cpp file further fixing initial work for fixed types...potentially needing a constant literal type for this
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 ab02e0b5..14bc0855 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::IntegerConstant)
+ if (_unaryOperation.annotation().type->category() == Type::Category::NumberConstant)
{
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::IntegerConstant)
+ else if (commonType.category() == Type::Category::NumberConstant)
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::IntegerConstant;
+ return dynamic_cast<Literal const*>(&_e) || _e.annotation().type->category() == Type::Category::NumberConstant;
};
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::IntegerConstant:
+ case Type::Category::NumberConstant:
case Type::Category::Bool:
m_context << type->literalValue(&_literal);
break;