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:
@@ -45,8 +45,6 @@ using AssemblyPointer = std::shared_ptr<Assembly>;
|
||||
class Assembly
|
||||
{
|
||||
public:
|
||||
Assembly() {}
|
||||
|
||||
AssemblyItem newTag() { assertThrow(m_usedTags < 0xffffffff, AssemblyException, ""); return AssemblyItem(Tag, m_usedTags++); }
|
||||
AssemblyItem newPushTag() { assertThrow(m_usedTags < 0xffffffff, AssemblyException, ""); return AssemblyItem(PushTag, m_usedTags++); }
|
||||
/// Returns a tag identified by the given name. Creates it if it does not yet exist.
|
||||
|
||||
@@ -304,7 +304,7 @@ KnownState::StoreOperation KnownState::storeInStorage(
|
||||
|
||||
AssemblyItem item(Instruction::SSTORE, _location);
|
||||
Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber);
|
||||
StoreOperation operation(StoreOperation::Storage, _slot, m_sequenceNumber, id);
|
||||
StoreOperation operation{StoreOperation::Storage, _slot, m_sequenceNumber, id};
|
||||
m_storageContent[_slot] = _value;
|
||||
// increment a second time so that we get unique sequence numbers for writes
|
||||
m_sequenceNumber++;
|
||||
@@ -336,7 +336,7 @@ KnownState::StoreOperation KnownState::storeInMemory(Id _slot, Id _value, Source
|
||||
|
||||
AssemblyItem item(Instruction::MSTORE, _location);
|
||||
Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber);
|
||||
StoreOperation operation(StoreOperation(StoreOperation::Memory, _slot, m_sequenceNumber, id));
|
||||
StoreOperation operation{StoreOperation::Memory, _slot, m_sequenceNumber, id};
|
||||
m_memoryContent[_slot] = _value;
|
||||
// increment a second time so that we get unique sequence numbers for writes
|
||||
m_sequenceNumber++;
|
||||
|
||||
+6
-11
@@ -74,18 +74,13 @@ public:
|
||||
struct StoreOperation
|
||||
{
|
||||
enum Target { Invalid, Memory, Storage };
|
||||
StoreOperation(): target(Invalid), sequenceNumber(-1) {}
|
||||
StoreOperation(
|
||||
Target _target,
|
||||
Id _slot,
|
||||
unsigned _sequenceNumber,
|
||||
Id _expression
|
||||
): target(_target), slot(_slot), sequenceNumber(_sequenceNumber), expression(_expression) {}
|
||||
|
||||
bool isValid() const { return target != Invalid; }
|
||||
Target target;
|
||||
Id slot;
|
||||
unsigned sequenceNumber;
|
||||
Id expression;
|
||||
|
||||
Target target{Invalid};
|
||||
Id slot{std::numeric_limits<Id>::max()};
|
||||
unsigned sequenceNumber{std::numeric_limits<unsigned>::max()};
|
||||
Id expression{std::numeric_limits<Id>::max()};
|
||||
};
|
||||
|
||||
explicit KnownState(
|
||||
|
||||
Reference in New Issue
Block a user