aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-11-28 22:00:23 +0800
committerchriseth <chris@ethereum.org>2017-12-05 19:09:55 +0800
commit30d7afc2e3fd27333e463a9127011ec1f7470d3e (patch)
tree8ce2d4115ec56f61770f8dfea3383a437e89c010 /libjulia
parentcba58629d24404ed7553d16bb2ad064f95f9fe37 (diff)
downloaddexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar.gz
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar.zst
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.zip
Simplify disambiguator.
Diffstat (limited to 'libjulia')
-rw-r--r--libjulia/optimiser/ASTCopier.cpp5
-rw-r--r--libjulia/optimiser/ASTCopier.h18
-rw-r--r--libjulia/optimiser/Disambiguator.h6
3 files changed, 7 insertions, 22 deletions
diff --git a/libjulia/optimiser/ASTCopier.cpp b/libjulia/optimiser/ASTCopier.cpp
index 2f9eade3..d777d731 100644
--- a/libjulia/optimiser/ASTCopier.cpp
+++ b/libjulia/optimiser/ASTCopier.cpp
@@ -31,11 +31,6 @@ using namespace dev;
using namespace dev::julia;
-shared_ptr<Block> ASTCopier::run()
-{
- return make_shared<Block>(translate(m_block));
-}
-
Statement ASTCopier::operator()(Instruction const& _instruction)
{
return _instruction;
diff --git a/libjulia/optimiser/ASTCopier.h b/libjulia/optimiser/ASTCopier.h
index 759dce31..0658fd50 100644
--- a/libjulia/optimiser/ASTCopier.h
+++ b/libjulia/optimiser/ASTCopier.h
@@ -27,6 +27,7 @@
#include <vector>
#include <set>
+#include <memory>
namespace dev
{
@@ -40,13 +41,6 @@ namespace julia
class ASTCopier: public boost::static_visitor<Statement>
{
public:
- ASTCopier(Block const& _block):
- m_block(_block)
- {}
-
- std::shared_ptr<Block> run();
-
-public:
Statement operator()(Literal const& _literal);
Statement operator()(Instruction const& _instruction);
Statement operator()(Identifier const& _identifier);
@@ -78,13 +72,11 @@ protected:
Literal translate(Literal const& _literal);
TypedName translate(TypedName const& _typedName);
- virtual void enterScope(Block const& _block) = 0;
- virtual void leaveScope(Block const& _block) = 0;
- virtual void enterFunction(FunctionDefinition const& _function) = 0;
- virtual void leaveFunction(FunctionDefinition const& _function) = 0;
+ virtual void enterScope(Block const&) { }
+ virtual void leaveScope(Block const&) { }
+ virtual void enterFunction(FunctionDefinition const&) { }
+ virtual void leaveFunction(FunctionDefinition const&) { }
virtual std::string translateIdentifier(std::string const& _name) { return _name; }
-
- Block const& m_block;
};
template <typename T>
diff --git a/libjulia/optimiser/Disambiguator.h b/libjulia/optimiser/Disambiguator.h
index 39615cf7..cc9488d5 100644
--- a/libjulia/optimiser/Disambiguator.h
+++ b/libjulia/optimiser/Disambiguator.h
@@ -43,10 +43,8 @@ class EVMAssembly;
class Disambiguator: public ASTCopier
{
public:
- Disambiguator(
- Block const& _block,
- solidity::assembly::AsmAnalysisInfo const& _analysisInfo
- ): ASTCopier(_block), m_info(_analysisInfo)
+ Disambiguator(solidity::assembly::AsmAnalysisInfo const& _analysisInfo):
+ m_info(_analysisInfo)
{}
protected: