diff options
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -192,7 +192,7 @@ u256 IntegerType::literalValue(Literal const& _literal) const const MemberList IntegerType::AddressMemberList = MemberList({{"balance", make_shared<IntegerType const>(256)}, {"send", make_shared<FunctionType const>(TypePointers({make_shared<IntegerType const>(256)}), - TypePointers())}}); + TypePointers(), FunctionType::Location::SEND)}}); bool BoolType::isExplicitlyConvertibleTo(Type const& _convertTo) const { @@ -314,6 +314,7 @@ FunctionType::FunctionType(FunctionDefinition const& _function) retParams.push_back(var->getType()); swap(params, m_parameterTypes); swap(retParams, m_returnParameterTypes); + m_location = Location::INTERNAL; } bool FunctionType::operator==(Type const& _other) const @@ -347,6 +348,19 @@ string FunctionType::toString() const return name + ")"; } +unsigned FunctionType::getSizeOnStack() const +{ + switch (m_location) + { + case Location::INTERNAL: + return 1; + case Location::EXTERNAL: + return 2; + default: + return 0; + } +} + bool MappingType::operator==(Type const& _other) const { if (_other.getCategory() != getCategory()) |