aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-03-27 20:28:32 +0800
committerLiana Husikyan <liana@ethdev.com>2015-03-27 20:28:32 +0800
commita3d829d074859d748f1fd392acb8b5883f646e61 (patch)
tree83297cd3280973d788bc366bb04bf83c3ef339b0 /Types.cpp
parentb1ca27ea93907dc500d0b84298f5d63a9d4a7c1d (diff)
downloaddexon-solidity-a3d829d074859d748f1fd392acb8b5883f646e61.tar
dexon-solidity-a3d829d074859d748f1fd392acb8b5883f646e61.tar.gz
dexon-solidity-a3d829d074859d748f1fd392acb8b5883f646e61.tar.bz2
dexon-solidity-a3d829d074859d748f1fd392acb8b5883f646e61.tar.lz
dexon-solidity-a3d829d074859d748f1fd392acb8b5883f646e61.tar.xz
dexon-solidity-a3d829d074859d748f1fd392acb8b5883f646e61.tar.zst
dexon-solidity-a3d829d074859d748f1fd392acb8b5883f646e61.zip
added externalTypes function to functionType
removed flag for externalSigniture
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/Types.cpp b/Types.cpp
index 1776413a..5fd7d24a 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -1098,6 +1098,19 @@ unsigned FunctionType::getSizeOnStack() const
return size;
}
+TypePointer FunctionType::externalType() const
+{
+ TypePointers paramTypes;
+ TypePointers retParamTypes;
+
+ for (auto it = m_parameterTypes.cbegin(); it != m_parameterTypes.cend(); ++it)
+ paramTypes.push_back((*it)->externalType());
+ for (auto it = m_returnParameterTypes.cbegin(); it != m_returnParameterTypes.cend(); ++it)
+ retParamTypes.push_back((*it)->externalType());
+
+ return make_shared<FunctionType>(paramTypes, retParamTypes, m_location, m_arbitraryParameters);
+}
+
MemberList const& FunctionType::getMembers() const
{
switch (m_location)
@@ -1127,7 +1140,7 @@ MemberList const& FunctionType::getMembers() const
}
}
-string FunctionType::externalSignature(bool isExternalCall, std::string const& _name) const
+string FunctionType::externalSignature(std::string const& _name) const
{
std::string funcName = _name;
if (_name == "")
@@ -1137,12 +1150,13 @@ string FunctionType::externalSignature(bool isExternalCall, std::string const& _
}
string ret = funcName + "(";
- for (auto it = m_parameterTypes.cbegin(); it != m_parameterTypes.cend(); ++it)
+ TypePointers externalParameterTypes = dynamic_cast<FunctionType const&>(*externalType()).getParameterTypes();
+ for (auto it = externalParameterTypes.cbegin(); it != externalParameterTypes.cend(); ++it)
{
- if (isExternalCall)
- solAssert(!!(*it)->externalType(), "Parameter should have external type");
- ret += (isExternalCall ? (*it)->externalType()->toString() : (*it)->toString()) + (it + 1 == m_parameterTypes.cend() ? "" : ",");
+ solAssert(!!(*it), "Parameter should have external type");
+ ret += (*it)->toString() + (it + 1 == externalParameterTypes.cend() ? "" : ",");
}
+
return ret + ")";
}