aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-09 17:24:40 +0800
committerGitHub <noreply@github.com>2018-02-09 17:24:40 +0800
commit2095e7a32dce04f6142074bf96f14b6c7046137a (patch)
tree99bb5ac4d50ec29408d6bdc1332e99c3ec83a772
parent56a96213b1644a172204d69b648269f0fe720fab (diff)
parent96fe589f3ce4b8b2ca11fa7cff3f27a5acc83121 (diff)
downloaddexon-solidity-2095e7a32dce04f6142074bf96f14b6c7046137a.tar.gz
dexon-solidity-2095e7a32dce04f6142074bf96f14b6c7046137a.tar.zst
dexon-solidity-2095e7a32dce04f6142074bf96f14b6c7046137a.zip
Merge pull request #3472 from ethereum/removeemptyblocks
Use removeEmptyBlocks helper in FunctionHoister
-rw-r--r--libjulia/optimiser/FunctionHoister.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/libjulia/optimiser/FunctionHoister.cpp b/libjulia/optimiser/FunctionHoister.cpp
index 9cf67f23..63f6edb9 100644
--- a/libjulia/optimiser/FunctionHoister.cpp
+++ b/libjulia/optimiser/FunctionHoister.cpp
@@ -21,6 +21,7 @@
*/
#include <libjulia/optimiser/FunctionHoister.h>
+#include <libjulia/optimiser/Utilities.h>
#include <libsolidity/inlineasm/AsmData.h>
@@ -28,14 +29,11 @@
#include <libdevcore/CommonData.h>
-#include <boost/range/algorithm_ext/erase.hpp>
-
using namespace std;
using namespace dev;
using namespace dev::julia;
using namespace dev::solidity;
-
void FunctionHoister::operator()(Block& _block)
{
bool topLevel = m_isTopLevel;
@@ -49,11 +47,7 @@ void FunctionHoister::operator()(Block& _block)
statement = Block{_block.location, {}};
}
}
- auto isEmptyBlock = [](Statement const& _st) -> bool {
- return _st.type() == typeid(Block) && boost::get<Block>(_st).statements.empty();
- };
- // Remove empty blocks
- boost::range::remove_erase_if(_block.statements, isEmptyBlock);
+ removeEmptyBlocks(_block);
if (topLevel)
_block.statements += std::move(m_functions);
}