aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-12 00:35:23 +0800
committerChristian <c@ethdev.com>2014-12-12 00:48:44 +0800
commit66d95abfd9d0a1c3d6516dec39d085d7d96cccbf (patch)
tree53e5437546d139627742a77df25c41bafb9e0005 /ExpressionCompiler.h
parent6fcdfdc353cb4100f8a1a3c139e0fa9dc9302397 (diff)
downloaddexon-solidity-66d95abfd9d0a1c3d6516dec39d085d7d96cccbf.tar.gz
dexon-solidity-66d95abfd9d0a1c3d6516dec39d085d7d96cccbf.tar.zst
dexon-solidity-66d95abfd9d0a1c3d6516dec39d085d7d96cccbf.zip
Swap literals to the end if optimizing.
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r--ExpressionCompiler.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h
index 41cb6676..fb4577c8 100644
--- a/ExpressionCompiler.h
+++ b/ExpressionCompiler.h
@@ -45,14 +45,14 @@ class ExpressionCompiler: private ASTConstVisitor
{
public:
/// Compile the given @a _expression into the @a _context.
- static void compileExpression(CompilerContext& _context, Expression const& _expression);
+ static void compileExpression(CompilerContext& _context, Expression const& _expression, bool _optimize = false);
/// Appends code to remove dirty higher order bits in case of an implicit promotion to a wider type.
static void appendTypeConversion(CompilerContext& _context, Type const& _typeOnStack, Type const& _targetType);
private:
- ExpressionCompiler(CompilerContext& _compilerContext):
- m_context(_compilerContext), m_currentLValue(m_context) {}
+ explicit ExpressionCompiler(CompilerContext& _compilerContext, bool _optimize = false):
+ m_optimize(_optimize), m_context(_compilerContext), m_currentLValue(m_context) {}
virtual bool visit(Assignment const& _assignment) override;
virtual void endVisit(UnaryOperation const& _unaryOperation) override;
@@ -132,6 +132,7 @@ private:
unsigned m_stackSize;
};
+ bool m_optimize;
CompilerContext& m_context;
LValue m_currentLValue;
};