Allow using calldata keyword to specify data location

This commit is contained in:
mingchuan
2018-05-30 18:05:55 +08:00
parent 9d5064d04d
commit b7cafcbdf9
25 changed files with 155 additions and 25 deletions
+11 -3
View File
@@ -1469,12 +1469,20 @@ string ReferenceType::stringForReferencePart() const
string ReferenceType::identifierLocationSuffix() const
{
string id;
if (location() == DataLocation::Storage)
switch (location())
{
case DataLocation::Storage:
id += "_storage";
else if (location() == DataLocation::Memory)
break;
case DataLocation::Memory:
id += "_memory";
else
break;
case DataLocation::CallData:
id += "_calldata";
break;
default:
solAssert(false, "Unknown location returned by location()");
}
if (isPointer())
id += "_ptr";
return id;