diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-05-09 17:43:14 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-05-09 18:28:49 +0800 |
commit | 591c591af05f29bf42b8b162a4fcda5a9a8fae9f (patch) | |
tree | a448d572df111ba938bbca43098864852507236a /libjulia/optimiser/FullInliner.cpp | |
parent | 7bbfd77e8e924f4946fcc99d4334d7e8ad3cc8de (diff) | |
download | dexon-solidity-591c591af05f29bf42b8b162a4fcda5a9a8fae9f.tar dexon-solidity-591c591af05f29bf42b8b162a4fcda5a9a8fae9f.tar.gz dexon-solidity-591c591af05f29bf42b8b162a4fcda5a9a8fae9f.tar.bz2 dexon-solidity-591c591af05f29bf42b8b162a4fcda5a9a8fae9f.tar.lz dexon-solidity-591c591af05f29bf42b8b162a4fcda5a9a8fae9f.tar.xz dexon-solidity-591c591af05f29bf42b8b162a4fcda5a9a8fae9f.tar.zst dexon-solidity-591c591af05f29bf42b8b162a4fcda5a9a8fae9f.zip |
Do not use solAssert within libjulia
Diffstat (limited to 'libjulia/optimiser/FullInliner.cpp')
-rw-r--r-- | libjulia/optimiser/FullInliner.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libjulia/optimiser/FullInliner.cpp b/libjulia/optimiser/FullInliner.cpp index 05d70729..e78f4eb0 100644 --- a/libjulia/optimiser/FullInliner.cpp +++ b/libjulia/optimiser/FullInliner.cpp @@ -24,11 +24,10 @@ #include <libjulia/optimiser/ASTWalker.h> #include <libjulia/optimiser/NameCollector.h> #include <libjulia/optimiser/Semantics.h> +#include <libjulia/Exceptions.h> #include <libsolidity/inlineasm/AsmData.h> -#include <libsolidity/interface/Exceptions.h> - #include <libdevcore/CommonData.h> #include <boost/range/adaptor/reversed.hpp> @@ -38,18 +37,16 @@ using namespace dev; using namespace dev::julia; using namespace dev::solidity; - - FullInliner::FullInliner(Block& _ast): m_ast(_ast) { - solAssert(m_ast.statements.size() >= 1, ""); - solAssert(m_ast.statements.front().type() == typeid(Block), ""); + assertThrow(m_ast.statements.size() >= 1, OptimizerException, ""); + assertThrow(m_ast.statements.front().type() == typeid(Block), OptimizerException, ""); m_nameDispenser.m_usedNames = NameCollector(m_ast).names(); for (size_t i = 1; i < m_ast.statements.size(); ++i) { - solAssert(m_ast.statements.at(i).type() == typeid(FunctionDefinition), ""); + assertThrow(m_ast.statements.at(i).type() == typeid(FunctionDefinition), OptimizerException, ""); FunctionDefinition& fun = boost::get<FunctionDefinition>(m_ast.statements.at(i)); m_functions[fun.name] = &fun; m_functionsToVisit.insert(&fun); @@ -58,7 +55,7 @@ FullInliner::FullInliner(Block& _ast): void FullInliner::run() { - solAssert(m_ast.statements[0].type() == typeid(Block), ""); + assertThrow(m_ast.statements[0].type() == typeid(Block), OptimizerException, ""); InlineModifier(*this, m_nameDispenser, "").visit(m_ast.statements[0]); while (!m_functionsToVisit.empty()) handleFunction(**m_functionsToVisit.begin()); @@ -79,7 +76,7 @@ void InlineModifier::operator()(FunctionalInstruction& _instruction) void InlineModifier::operator()(FunctionCall&) { - solAssert(false, "Should be handled in visit() instead."); + assertThrow(false, OptimizerException, "Should be handled in visit() instead."); } void InlineModifier::operator()(ForLoop& _loop) @@ -249,7 +246,7 @@ Statement BodyCopier::operator()(VariableDeclaration const& _varDecl) Statement BodyCopier::operator()(FunctionDefinition const& _funDef) { - solAssert(false, "Function hoisting has to be done before function inlining."); + assertThrow(false, OptimizerException, "Function hoisting has to be done before function inlining."); return _funDef; } |