diff options
author | Christian Parpart <christian@ethereum.org> | 2018-12-12 21:51:22 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-12-19 18:26:42 +0800 |
commit | 62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a (patch) | |
tree | c2592dc9a8a1abae524717c0d081e51bf1ed3c24 /libyul | |
parent | d10bae245ed441314c3bd6ecc74b2a1f3d060d12 (diff) | |
download | dexon-solidity-62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a.tar.gz dexon-solidity-62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a.tar.zst dexon-solidity-62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a.zip |
make use of C++ `= default` constructor declarations as well as more non-static member initialization syntax.
Diffstat (limited to 'libyul')
-rw-r--r-- | libyul/Dialect.h | 2 | ||||
-rw-r--r-- | libyul/Object.h | 2 | ||||
-rw-r--r-- | libyul/YulString.h | 12 | ||||
-rw-r--r-- | libyul/backends/evm/AbstractAssembly.h | 2 | ||||
-rw-r--r-- | libyul/backends/evm/EVMAssembly.h | 2 | ||||
-rw-r--r-- | libyul/backends/evm/EVMDialect.cpp | 2 | ||||
-rw-r--r-- | libyul/optimiser/RedundantAssignEliminator.h | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/libyul/Dialect.h b/libyul/Dialect.h index 2def566c..01fd98df 100644 --- a/libyul/Dialect.h +++ b/libyul/Dialect.h @@ -54,7 +54,7 @@ struct Dialect: boost::noncopyable virtual BuiltinFunction const* builtin(YulString /*_name*/) const { return nullptr; } Dialect(AsmFlavour _flavour): flavour(_flavour) {} - virtual ~Dialect() {} + virtual ~Dialect() = default; static std::shared_ptr<Dialect> yul() { diff --git a/libyul/Object.h b/libyul/Object.h index cfd8d02d..8484eb53 100644 --- a/libyul/Object.h +++ b/libyul/Object.h @@ -37,7 +37,7 @@ struct AsmAnalysisInfo; */ struct ObjectNode { - virtual ~ObjectNode() {} + virtual ~ObjectNode() = default; virtual std::string toString(bool _yul) const = 0; YulString name; diff --git a/libyul/YulString.h b/libyul/YulString.h index 35c1d92d..5cea5619 100644 --- a/libyul/YulString.h +++ b/libyul/YulString.h @@ -42,10 +42,9 @@ public: size_t id; std::uint64_t hash; }; - YulStringRepository(): - m_strings{std::make_shared<std::string>()}, - m_hashToID{std::make_pair(emptyHash(), 0)} - {} + + YulStringRepository() = default; + static YulStringRepository& instance() { static YulStringRepository inst; @@ -80,9 +79,10 @@ public: return hash; } static constexpr std::uint64_t emptyHash() { return 14695981039346656037u; } + private: - std::vector<std::shared_ptr<std::string>> m_strings; - std::unordered_multimap<std::uint64_t, size_t> m_hashToID; + std::vector<std::shared_ptr<std::string>> m_strings = {std::make_shared<std::string>()}; + std::unordered_multimap<std::uint64_t, size_t> m_hashToID = {{emptyHash(), 0}}; }; /// Wrapper around handles into the YulString repository. diff --git a/libyul/backends/evm/AbstractAssembly.h b/libyul/backends/evm/AbstractAssembly.h index 1f224ded..0cc41056 100644 --- a/libyul/backends/evm/AbstractAssembly.h +++ b/libyul/backends/evm/AbstractAssembly.h @@ -55,7 +55,7 @@ public: using LabelID = size_t; using SubID = size_t; - virtual ~AbstractAssembly() {} + virtual ~AbstractAssembly() = default; /// Set a new source location valid starting from the next instruction. virtual void setSourceLocation(langutil::SourceLocation const& _location) = 0; diff --git a/libyul/backends/evm/EVMAssembly.h b/libyul/backends/evm/EVMAssembly.h index cef9c19a..e62bc87e 100644 --- a/libyul/backends/evm/EVMAssembly.h +++ b/libyul/backends/evm/EVMAssembly.h @@ -38,7 +38,7 @@ class EVMAssembly: public AbstractAssembly { public: explicit EVMAssembly(bool _evm15 = false): m_evm15(_evm15) { } - virtual ~EVMAssembly() {} + virtual ~EVMAssembly() = default; /// Set a new source location valid starting from the next instruction. void setSourceLocation(langutil::SourceLocation const& _location) override; diff --git a/libyul/backends/evm/EVMDialect.cpp b/libyul/backends/evm/EVMDialect.cpp index 33ee19d4..935f05c6 100644 --- a/libyul/backends/evm/EVMDialect.cpp +++ b/libyul/backends/evm/EVMDialect.cpp @@ -38,7 +38,7 @@ using namespace dev::solidity; EVMDialect::EVMDialect(AsmFlavour _flavour, bool _objectAccess): - Dialect(_flavour), m_objectAccess(_objectAccess) + Dialect{_flavour}, m_objectAccess(_objectAccess) { // The EVM instructions will be moved to builtins at some point. if (!m_objectAccess) diff --git a/libyul/optimiser/RedundantAssignEliminator.h b/libyul/optimiser/RedundantAssignEliminator.h index 54d65823..4f82e7a2 100644 --- a/libyul/optimiser/RedundantAssignEliminator.h +++ b/libyul/optimiser/RedundantAssignEliminator.h @@ -115,7 +115,7 @@ public: static void run(Block& _ast); private: - RedundantAssignEliminator() {} + RedundantAssignEliminator() = default; class State { |