aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-02-25 16:53:28 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-02-25 16:53:28 +0800
commit54121a0d787df1b730fa523b21040c312dda4bf6 (patch)
treee877533709f76cd894cd4610e3dda5567d963576
parentfb328b778cdd0c6022ce072689cb3d8b333232f8 (diff)
downloaddexon-solidity-54121a0d787df1b730fa523b21040c312dda4bf6.tar
dexon-solidity-54121a0d787df1b730fa523b21040c312dda4bf6.tar.gz
dexon-solidity-54121a0d787df1b730fa523b21040c312dda4bf6.tar.bz2
dexon-solidity-54121a0d787df1b730fa523b21040c312dda4bf6.tar.lz
dexon-solidity-54121a0d787df1b730fa523b21040c312dda4bf6.tar.xz
dexon-solidity-54121a0d787df1b730fa523b21040c312dda4bf6.tar.zst
dexon-solidity-54121a0d787df1b730fa523b21040c312dda4bf6.zip
Styling changes for SourceLocation and friends
-rw-r--r--Compiler.h1
-rw-r--r--CompilerContext.cpp8
-rw-r--r--CompilerContext.h2
-rw-r--r--ExpressionCompiler.cpp2
4 files changed, 7 insertions, 6 deletions
diff --git a/Compiler.h b/Compiler.h
index a35a18e1..67f3a18e 100644
--- a/Compiler.h
+++ b/Compiler.h
@@ -41,6 +41,7 @@ public:
bytes getAssembledBytecode() { return m_context.getAssembledBytecode(m_optimize); }
bytes getRuntimeBytecode() { return m_runtimeContext.getAssembledBytecode(m_optimize);}
void streamAssembly(std::ostream& _stream) const { m_context.streamAssembly(_stream); }
+ /// Getters for compiler contexts. Only for testing purposes.
CompilerContext const& getContext() const { return m_context; }
CompilerContext const& getRuntimeContext() const { return m_runtimeContext; }
diff --git a/CompilerContext.cpp b/CompilerContext.cpp
index 5fd91e43..8bb6cb00 100644
--- a/CompilerContext.cpp
+++ b/CompilerContext.cpp
@@ -175,28 +175,28 @@ void CompilerContext::resetVisitedNodes(ASTNode const* _node)
CompilerContext& CompilerContext::operator<<(eth::AssemblyItem _item)
{
- solAssert(m_visitedNodes.size() > 0, "No node on the visited stack");
+ solAssert(!m_visitedNodes.empty(), "No node on the visited stack");
m_asm.append(_item, m_visitedNodes.top()->getLocation());
return *this;
}
CompilerContext& CompilerContext::operator<<(eth::Instruction _instruction)
{
- solAssert(m_visitedNodes.size() > 0, "No node on the visited stack");
+ solAssert(!m_visitedNodes.empty(), "No node on the visited stack");
m_asm.append(_instruction, m_visitedNodes.top()->getLocation());
return *this;
}
CompilerContext& CompilerContext::operator<<(u256 const& _value)
{
- solAssert(m_visitedNodes.size() > 0, "No node on the visited stack");
+ solAssert(!m_visitedNodes.empty(), "No node on the visited stack");
m_asm.append(_value, m_visitedNodes.top()->getLocation());
return *this;
}
CompilerContext& CompilerContext::operator<<(bytes const& _data)
{
- solAssert(m_visitedNodes.size() > 0, "No node on the visited stack");
+ solAssert(!m_visitedNodes.empty(), "No node on the visited stack");
m_asm.append(_data, m_visitedNodes.top()->getLocation());
return *this;
}
diff --git a/CompilerContext.h b/CompilerContext.h
index 6ee52a5b..6e1dbfbc 100644
--- a/CompilerContext.h
+++ b/CompilerContext.h
@@ -103,7 +103,7 @@ public:
/// Resets the stack of visited nodes with a new stack having only @c _node
void resetVisitedNodes(ASTNode const* _node);
/// Pops the stack of visited nodes
- void popVisitedNodes() { m_visitedNodes.pop();}
+ void popVisitedNodes() { m_visitedNodes.pop(); }
/// Pushes an ASTNode to the stack of visited nodes
void pushVisitedNodes(ASTNode const* _node) { m_visitedNodes.push(_node); }
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index 5a78aaad..90a3f3ac 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -165,7 +165,7 @@ bool ExpressionCompiler::visit(UnaryOperation const& _unaryOperation)
bool ExpressionCompiler::visit(BinaryOperation const& _binaryOperation)
{
- CompilerContext::LocationSetter locationSetter(m_context, &_binaryOperation);
+ CompilerContext::LocationSetter locationSetter(m_context, &_binaryOperation);
Expression const& leftExpression = _binaryOperation.getLeftExpression();
Expression const& rightExpression = _binaryOperation.getRightExpression();
Type const& commonType = _binaryOperation.getCommonType();