aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.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 /Compiler.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 'Compiler.h')
-rw-r--r--Compiler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Compiler.h b/Compiler.h
index 4b8f02c5..639e9841 100644
--- a/Compiler.h
+++ b/Compiler.h
@@ -30,10 +30,10 @@ namespace solidity {
class Compiler: private ASTConstVisitor
{
public:
- Compiler(): m_returnTag(m_context.newTag()) {}
+ explicit Compiler(bool _optimize = false): m_optimize(_optimize), m_returnTag(m_context.newTag()) {}
void compileContract(ContractDefinition const& _contract, std::vector<MagicVariableDeclaration const*> const& _magicGlobals);
- bytes getAssembledBytecode(bool _optimize = false) { return m_context.getAssembledBytecode(_optimize); }
+ bytes getAssembledBytecode() { return m_context.getAssembledBytecode(m_optimize); }
void streamAssembly(std::ostream& _stream) const { m_context.streamAssembly(_stream); }
private:
@@ -57,7 +57,9 @@ private:
virtual bool visit(VariableDefinition const& _variableDefinition) override;
virtual bool visit(ExpressionStatement const& _expressionStatement) override;
+ void compileExpression(Expression const& _expression);
+ bool const m_optimize;
CompilerContext m_context;
std::vector<eth::AssemblyItem> m_breakTags; ///< tag to jump to for a "break" statement
std::vector<eth::AssemblyItem> m_continueTags; ///< tag to jump to for a "continue" statement