diff options
author | Christian <c@ethdev.com> | 2014-12-06 08:06:24 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-08 19:49:03 +0800 |
commit | c78c330634997e5d8e2ec27db9e3d9cf50bae230 (patch) | |
tree | b47e89a21d6686ca49478528ace3e239836dbb0e /Compiler.cpp | |
parent | 41b8d7b7f1221c6caae142a6833228ccd098ef5b (diff) | |
download | dexon-solidity-c78c330634997e5d8e2ec27db9e3d9cf50bae230.tar.gz dexon-solidity-c78c330634997e5d8e2ec27db9e3d9cf50bae230.tar.zst dexon-solidity-c78c330634997e5d8e2ec27db9e3d9cf50bae230.zip |
Const AST visitor for the compiler.
Diffstat (limited to 'Compiler.cpp')
-rw-r--r-- | Compiler.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index 17ad4fd1..8c5d26f1 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -32,7 +32,7 @@ using namespace std; namespace dev { namespace solidity { -void Compiler::compileContract(ContractDefinition& _contract, vector<MagicVariableDeclaration const*> const& _magicGlobals) +void Compiler::compileContract(ContractDefinition const& _contract, vector<MagicVariableDeclaration const*> const& _magicGlobals) { m_context = CompilerContext(); // clear it just in case @@ -179,7 +179,7 @@ void Compiler::registerStateVariables(ContractDefinition const& _contract) m_context.addStateVariable(*variable); } -bool Compiler::visit(FunctionDefinition& _function) +bool Compiler::visit(FunctionDefinition const& _function) { //@todo to simplify this, the calling convention could by changed such that // caller puts: [retarg0] ... [retargm] [return address] [arg0] ... [argn] @@ -240,7 +240,7 @@ bool Compiler::visit(FunctionDefinition& _function) return false; } -bool Compiler::visit(IfStatement& _ifStatement) +bool Compiler::visit(IfStatement const& _ifStatement) { ExpressionCompiler::compileExpression(m_context, _ifStatement.getCondition()); eth::AssemblyItem trueTag = m_context.appendConditionalJump(); @@ -253,7 +253,7 @@ bool Compiler::visit(IfStatement& _ifStatement) return false; } -bool Compiler::visit(WhileStatement& _whileStatement) +bool Compiler::visit(WhileStatement const& _whileStatement) { eth::AssemblyItem loopStart = m_context.newTag(); eth::AssemblyItem loopEnd = m_context.newTag(); @@ -275,21 +275,21 @@ bool Compiler::visit(WhileStatement& _whileStatement) return false; } -bool Compiler::visit(Continue&) +bool Compiler::visit(Continue const&) { if (!m_continueTags.empty()) m_context.appendJumpTo(m_continueTags.back()); return false; } -bool Compiler::visit(Break&) +bool Compiler::visit(Break const&) { if (!m_breakTags.empty()) m_context.appendJumpTo(m_breakTags.back()); return false; } -bool Compiler::visit(Return& _return) +bool Compiler::visit(Return const& _return) { //@todo modifications are needed to make this work with functions returning multiple values if (Expression* expression = _return.getExpression()) @@ -305,7 +305,7 @@ bool Compiler::visit(Return& _return) return false; } -bool Compiler::visit(VariableDefinition& _variableDefinition) +bool Compiler::visit(VariableDefinition const& _variableDefinition) { if (Expression* expression = _variableDefinition.getExpression()) { @@ -320,7 +320,7 @@ bool Compiler::visit(VariableDefinition& _variableDefinition) return false; } -bool Compiler::visit(ExpressionStatement& _expressionStatement) +bool Compiler::visit(ExpressionStatement const& _expressionStatement) { Expression& expression = _expressionStatement.getExpression(); ExpressionCompiler::compileExpression(m_context, expression); |