Introduce global optimiser settings.

This commit is contained in:
Alex Beregszaszi
2019-03-04 11:40:28 +01:00
committed by chriseth
parent 0e475438a9
commit cf5c13f9c7
15 changed files with 218 additions and 39 deletions
+1 -1
View File
@@ -449,7 +449,7 @@ bool ExpressionCompiler::visit(BinaryOperation const& _binaryOperation)
{
return dynamic_cast<Literal const*>(&_e) || _e.annotation().type->category() == Type::Category::RationalNumber;
};
bool swap = m_optimize && TokenTraits::isCommutativeOp(c_op) && isLiteral(rightExpression) && !isLiteral(leftExpression);
bool swap = m_optimiseOrderLiterals && TokenTraits::isCommutativeOp(c_op) && isLiteral(rightExpression) && !isLiteral(leftExpression);
if (swap)
{
leftExpression.accept(*this);