mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
make use of C++ = default constructor declarations as well as more non-static member initialization syntax.
This commit is contained in:
+1
-1
@@ -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()
|
||||
{
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ struct AsmAnalysisInfo;
|
||||
*/
|
||||
struct ObjectNode
|
||||
{
|
||||
virtual ~ObjectNode() {}
|
||||
virtual ~ObjectNode() = default;
|
||||
virtual std::string toString(bool _yul) const = 0;
|
||||
|
||||
YulString name;
|
||||
|
||||
+6
-6
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
static void run(Block& _ast);
|
||||
|
||||
private:
|
||||
RedundantAssignEliminator() {}
|
||||
RedundantAssignEliminator() = default;
|
||||
|
||||
class State
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user