Merge remote-tracking branch 'origin/develop' into develop_060

This commit is contained in:
chriseth
2019-10-28 15:21:49 +01:00
67 changed files with 182 additions and 165 deletions
+4 -4
View File
@@ -957,11 +957,11 @@ string YulUtilFunctions::readFromCalldata(Type const& _type)
return readFromMemoryOrCalldata(_type, true);
}
string YulUtilFunctions::updateStorageValueFunction(Type const& _type, boost::optional<unsigned> const& _offset)
string YulUtilFunctions::updateStorageValueFunction(Type const& _type, std::optional<unsigned> const& _offset)
{
string const functionName =
"update_storage_value_" +
(_offset.is_initialized() ? ("offset_" + to_string(*_offset)) : "") +
(_offset.has_value() ? ("offset_" + to_string(*_offset)) : "") +
_type.identifier();
return m_functionCollector->createFunction(functionName, [&] {
@@ -978,11 +978,11 @@ string YulUtilFunctions::updateStorageValueFunction(Type const& _type, boost::op
)")
("functionName", functionName)
("update",
_offset.is_initialized() ?
_offset.has_value() ?
updateByteSliceFunction(_type.storageBytes(), *_offset) :
updateByteSliceFunctionDynamic(_type.storageBytes())
)
("offset", _offset.is_initialized() ? "" : "offset, ")
("offset", _offset.has_value() ? "" : "offset, ")
("prepare", prepareStoreFunction(_type))
.render();
}
+1 -1
View File
@@ -197,7 +197,7 @@ public:
/// the specified slot and offset. If offset is not given, it is expected as
/// runtime parameter.
/// signature: (slot, [offset,] value)
std::string updateStorageValueFunction(Type const& _type, boost::optional<unsigned> const& _offset = boost::optional<unsigned>());
std::string updateStorageValueFunction(Type const& _type, std::optional<unsigned> const& _offset = std::optional<unsigned>());
/// Returns the name of a function that will write the given value to
/// the specified address.
+1 -1
View File
@@ -115,7 +115,7 @@ string IRStorageItem::storeValue(string const& _value, Type const& _sourceType)
if (m_type->isValueType())
solAssert(_sourceType == *m_type, "Different type, but might not be an error.");
boost::optional<unsigned> offset;
std::optional<unsigned> offset;
if (m_offset.type() == typeid(unsigned))
offset = get<unsigned>(m_offset);