aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia/backends
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-12-08 21:01:22 +0800
committerchriseth <chris@ethereum.org>2017-12-13 19:28:15 +0800
commit54b6739962ef45319777ce2aebafdf4b91412d84 (patch)
treed15c289ebb4e57b16678b93e223bc477e9093b6c /libjulia/backends
parent7614b16dc9b2bb1e267e8f46834b40220fb9f9fb (diff)
downloaddexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar.gz
dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar.zst
dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.zip
Separate expression and statement.
Diffstat (limited to 'libjulia/backends')
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.cpp9
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.h3
2 files changed, 10 insertions, 2 deletions
diff --git a/libjulia/backends/evm/EVMCodeTransform.cpp b/libjulia/backends/evm/EVMCodeTransform.cpp
index f92939be..0c7365fb 100644
--- a/libjulia/backends/evm/EVMCodeTransform.cpp
+++ b/libjulia/backends/evm/EVMCodeTransform.cpp
@@ -77,6 +77,13 @@ void CodeTransform::operator()(StackAssignment const& _assignment)
checkStackHeight(&_assignment);
}
+void CodeTransform::operator()(ExpressionStatement const& _statement)
+{
+ m_assembly.setSourceLocation(_statement.location);
+ boost::apply_visitor(*this, _statement.expression);
+ checkStackHeight(&_statement);
+}
+
void CodeTransform::operator()(Label const& _label)
{
m_assembly.setSourceLocation(_label.location);
@@ -460,7 +467,7 @@ AbstractAssembly::LabelID CodeTransform::functionEntryID(string const& _name, Sc
return m_context->functionEntryIDs[&_function];
}
-void CodeTransform::visitExpression(Statement const& _expression)
+void CodeTransform::visitExpression(Expression const& _expression)
{
int height = m_assembly.stackHeight();
boost::apply_visitor(*this, _expression);
diff --git a/libjulia/backends/evm/EVMCodeTransform.h b/libjulia/backends/evm/EVMCodeTransform.h
index 577cc8ba..0f2aaf95 100644
--- a/libjulia/backends/evm/EVMCodeTransform.h
+++ b/libjulia/backends/evm/EVMCodeTransform.h
@@ -101,6 +101,7 @@ public:
void operator()(Identifier const& _identifier);
void operator()(FunctionalInstruction const& _instr);
void operator()(FunctionCall const&);
+ void operator()(ExpressionStatement const& _statement);
void operator()(Label const& _label);
void operator()(StackAssignment const& _assignment);
void operator()(Assignment const& _assignment);
@@ -118,7 +119,7 @@ private:
AbstractAssembly::LabelID labelID(solidity::assembly::Scope::Label const& _label);
AbstractAssembly::LabelID functionEntryID(std::string const& _name, solidity::assembly::Scope::Function const& _function);
/// Generates code for an expression that is supposed to return a single value.
- void visitExpression(Statement const& _expression);
+ void visitExpression(Expression const& _expression);
void visitStatements(std::vector<Statement> const& _statements);