mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make data location explicit.
This commit is contained in:
parent
2761aed1d3
commit
4e2d4f02b0
@ -237,9 +237,9 @@ Type const* TypeProvider::fromElementaryTypeName(ElementaryTypeNameToken const&
|
|||||||
case Token::Bool:
|
case Token::Bool:
|
||||||
return boolType();
|
return boolType();
|
||||||
case Token::Bytes:
|
case Token::Bytes:
|
||||||
return bytesType();
|
return bytesStorageType();
|
||||||
case Token::String:
|
case Token::String:
|
||||||
return stringType();
|
return stringStorageType();
|
||||||
default:
|
default:
|
||||||
solAssert(
|
solAssert(
|
||||||
false,
|
false,
|
||||||
@ -293,7 +293,7 @@ TypePointer TypeProvider::fromElementaryTypeName(string const& _name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayType const* TypeProvider::bytesType()
|
ArrayType const* TypeProvider::bytesStorageType()
|
||||||
{
|
{
|
||||||
if (!m_bytesStorageType)
|
if (!m_bytesStorageType)
|
||||||
m_bytesStorageType = make_unique<ArrayType>(DataLocation::Storage, false);
|
m_bytesStorageType = make_unique<ArrayType>(DataLocation::Storage, false);
|
||||||
@ -307,7 +307,7 @@ ArrayType const* TypeProvider::bytesMemoryType()
|
|||||||
return m_bytesMemoryType.get();
|
return m_bytesMemoryType.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayType const* TypeProvider::stringType()
|
ArrayType const* TypeProvider::stringStorageType()
|
||||||
{
|
{
|
||||||
if (!m_stringStorageType)
|
if (!m_stringStorageType)
|
||||||
m_stringStorageType = make_unique<ArrayType>(DataLocation::Storage, true);
|
m_stringStorageType = make_unique<ArrayType>(DataLocation::Storage, true);
|
||||||
@ -469,14 +469,14 @@ ArrayType const* TypeProvider::arrayType(DataLocation _location, bool _isString)
|
|||||||
if (_isString)
|
if (_isString)
|
||||||
{
|
{
|
||||||
if (_location == DataLocation::Storage)
|
if (_location == DataLocation::Storage)
|
||||||
return stringType();
|
return stringStorageType();
|
||||||
if (_location == DataLocation::Memory)
|
if (_location == DataLocation::Memory)
|
||||||
return stringMemoryType();
|
return stringMemoryType();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_location == DataLocation::Storage)
|
if (_location == DataLocation::Storage)
|
||||||
return bytesType();
|
return bytesStorageType();
|
||||||
if (_location == DataLocation::Memory)
|
if (_location == DataLocation::Memory)
|
||||||
return bytesMemoryType();
|
return bytesMemoryType();
|
||||||
}
|
}
|
||||||
|
@ -66,9 +66,9 @@ public:
|
|||||||
static FixedBytesType const* byteType() { return fixedBytesType(1); }
|
static FixedBytesType const* byteType() { return fixedBytesType(1); }
|
||||||
static FixedBytesType const* fixedBytesType(unsigned m) { return m_bytesM.at(m - 1).get(); }
|
static FixedBytesType const* fixedBytesType(unsigned m) { return m_bytesM.at(m - 1).get(); }
|
||||||
|
|
||||||
static ArrayType const* bytesType();
|
static ArrayType const* bytesStorageType();
|
||||||
static ArrayType const* bytesMemoryType();
|
static ArrayType const* bytesMemoryType();
|
||||||
static ArrayType const* stringType();
|
static ArrayType const* stringStorageType();
|
||||||
static ArrayType const* stringMemoryType();
|
static ArrayType const* stringMemoryType();
|
||||||
|
|
||||||
/// Constructor for a byte array ("bytes") and string.
|
/// Constructor for a byte array ("bytes") and string.
|
||||||
|
Loading…
Reference in New Issue
Block a user