aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-01-14 18:01:42 +0800
committerChristian <c@ethdev.com>2015-01-14 18:01:42 +0800
commitd1e05ac416c68d65112e9dd1427b8b009802afef (patch)
treead37b5d5e947d288b4216a5d4710cf7cef541d34 /Types.cpp
parent22f0a4fde1a641e36945c60c67d96559f7ab5981 (diff)
downloaddexon-solidity-d1e05ac416c68d65112e9dd1427b8b009802afef.tar
dexon-solidity-d1e05ac416c68d65112e9dd1427b8b009802afef.tar.gz
dexon-solidity-d1e05ac416c68d65112e9dd1427b8b009802afef.tar.bz2
dexon-solidity-d1e05ac416c68d65112e9dd1427b8b009802afef.tar.lz
dexon-solidity-d1e05ac416c68d65112e9dd1427b8b009802afef.tar.xz
dexon-solidity-d1e05ac416c68d65112e9dd1427b8b009802afef.tar.zst
dexon-solidity-d1e05ac416c68d65112e9dd1427b8b009802afef.zip
Remove redundancy in FunctionType::getSizeOnStack.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/Types.cpp b/Types.cpp
index ea2da0b6..6a1b120c 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -546,7 +546,8 @@ u256 StructType::getStorageOffsetOfMember(string const& _name) const
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Storage offset of non-existing member requested."));
}
-FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal)
+FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal):
+ m_location(_isInternal ? Location::INTERNAL : Location::EXTERNAL)
{
TypePointers params;
TypePointers retParams;
@@ -558,22 +559,6 @@ FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal
retParams.push_back(var->getType());
swap(params, m_parameterTypes);
swap(retParams, m_returnParameterTypes);
- m_location = _isInternal ? Location::INTERNAL : Location::EXTERNAL;
-}
-
-FunctionType::FunctionType(TypePointers const& _parameterTypes, TypePointers const& _returnParameterTypes,
- FunctionType::Location _location, bool _gasSet, bool _valueSet):
- m_parameterTypes(_parameterTypes), m_returnParameterTypes(_returnParameterTypes),
- m_location(_location), m_gasSet(_gasSet), m_valueSet(_valueSet)
-{
- if (m_location == Location::EXTERNAL)
- m_sizeOnStack = 2;
- else if (m_location == Location::INTERNAL || m_location == Location::BARE)
- m_sizeOnStack = 1;
- if (m_gasSet)
- m_sizeOnStack++;
- if (m_valueSet)
- m_sizeOnStack++;
}
bool FunctionType::operator==(Type const& _other) const
@@ -680,7 +665,6 @@ TypePointer FunctionType::copyAndSetGasOrValue(bool _setGas, bool _setValue) con
m_gasSet || _setGas, m_valueSet || _setValue);
}
-
bool MappingType::operator==(Type const& _other) const
{
if (_other.getCategory() != getCategory())