aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2014-12-11 00:19:01 +0800
committerchriseth <c@ethdev.com>2014-12-11 00:19:01 +0800
commit3c377f77bbe75e65159e79a61696ba906ac22bda (patch)
tree84dc67e67200c4f7deccda8504f0c9294d071890 /Compiler.cpp
parente8b7d266641175039d40c344449409a60527156e (diff)
parent9e120d45857506b2f448c2c18a688ff05b19009b (diff)
downloaddexon-solidity-3c377f77bbe75e65159e79a61696ba906ac22bda.tar.gz
dexon-solidity-3c377f77bbe75e65159e79a61696ba906ac22bda.tar.zst
dexon-solidity-3c377f77bbe75e65159e79a61696ba906ac22bda.zip
Merge pull request #577 from chriseth/sol_constCleanup
Solidity const cleanup
Diffstat (limited to 'Compiler.cpp')
-rw-r--r--Compiler.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/Compiler.cpp b/Compiler.cpp
index a8a07403..b094af19 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -33,7 +33,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
@@ -182,7 +182,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]
@@ -244,7 +244,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();
@@ -257,7 +257,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();
@@ -279,24 +279,24 @@ 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())
+ if (Expression const* expression = _return.getExpression())
{
ExpressionCompiler::compileExpression(m_context, *expression);
VariableDeclaration const& firstVariable = *_return.getFunctionReturnParameters().getParameters().front();
@@ -308,9 +308,9 @@ bool Compiler::visit(Return& _return)
return false;
}
-bool Compiler::visit(VariableDefinition& _variableDefinition)
+bool Compiler::visit(VariableDefinition const& _variableDefinition)
{
- if (Expression* expression = _variableDefinition.getExpression())
+ if (Expression const* expression = _variableDefinition.getExpression())
{
ExpressionCompiler::compileExpression(m_context, *expression);
ExpressionCompiler::appendTypeConversion(m_context,
@@ -321,9 +321,9 @@ bool Compiler::visit(VariableDefinition& _variableDefinition)
return false;
}
-bool Compiler::visit(ExpressionStatement& _expressionStatement)
+bool Compiler::visit(ExpressionStatement const& _expressionStatement)
{
- Expression& expression = _expressionStatement.getExpression();
+ Expression const& expression = _expressionStatement.getExpression();
ExpressionCompiler::compileExpression(m_context, expression);
CompilerUtils(m_context).popStackElement(*expression.getType());
return false;