aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChase McDermott <chasemcd1745@tamu.edu>2018-08-18 07:09:31 +0800
committerChase McDermott <chasemcd1745@tamu.edu>2018-08-18 07:15:22 +0800
commit551e0bf47cd0a1d1cb24a878f2309fd9f3253d00 (patch)
treec27807217402b60b6a9660d92f6db8d1de03cd2b
parent410d288dfc2e08c42df58c7e01ad5c332ce92727 (diff)
downloaddexon-solidity-551e0bf47cd0a1d1cb24a878f2309fd9f3253d00.tar.gz
dexon-solidity-551e0bf47cd0a1d1cb24a878f2309fd9f3253d00.tar.zst
dexon-solidity-551e0bf47cd0a1d1cb24a878f2309fd9f3253d00.zip
Rename Location::Default to Location::Unspecified.
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp8
-rw-r--r--libsolidity/analysis/TypeChecker.cpp2
-rw-r--r--libsolidity/ast/AST.cpp4
-rw-r--r--libsolidity/ast/AST.h4
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp2
-rw-r--r--libsolidity/parsing/Parser.cpp4
6 files changed, 12 insertions, 12 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index f33de7b7..8750b47b 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -332,7 +332,7 @@ void ReferencesResolver::endVisit(VariableDeclaration const& _variable)
case Location::Memory: return "\"memory\"";
case Location::Storage: return "\"storage\"";
case Location::CallData: return "\"calldata\"";
- case Location::Default: return "none";
+ case Location::Unspecified: return "none";
}
return {};
};
@@ -368,12 +368,12 @@ void ReferencesResolver::endVisit(VariableDeclaration const& _variable)
// Find correct data location.
if (_variable.isEventParameter())
{
- solAssert(varLoc == Location::Default, "");
+ solAssert(varLoc == Location::Unspecified, "");
typeLoc = DataLocation::Memory;
}
else if (_variable.isStateVariable())
{
- solAssert(varLoc == Location::Default, "");
+ solAssert(varLoc == Location::Unspecified, "");
typeLoc = _variable.isConstant() ? DataLocation::Memory : DataLocation::Storage;
}
else if (
@@ -394,7 +394,7 @@ void ReferencesResolver::endVisit(VariableDeclaration const& _variable)
case Location::CallData:
typeLoc = DataLocation::CallData;
break;
- case Location::Default:
+ case Location::Unspecified:
solAssert(!_variable.hasReferenceOrMappingType(), "Data location not properly set.");
}
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index fca64f6a..ae733cff 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -1217,7 +1217,7 @@ bool TypeChecker::visit(VariableDeclarationStatement const& _statement)
if (ref->dataStoredIn(DataLocation::Storage))
{
string errorText{"Uninitialized storage pointer."};
- if (varDecl.referenceLocation() == VariableDeclaration::Location::Default)
+ if (varDecl.referenceLocation() == VariableDeclaration::Location::Unspecified)
errorText += " Did you mean '<type> memory " + varDecl.name() + "'?";
solAssert(m_scope, "");
m_errorReporter.declarationError(varDecl.location(), errorText);
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp
index 635ab024..8e7a81a6 100644
--- a/libsolidity/ast/AST.cpp
+++ b/libsolidity/ast/AST.cpp
@@ -517,7 +517,7 @@ set<VariableDeclaration::Location> VariableDeclaration::allowedDataLocations() c
using Location = VariableDeclaration::Location;
if (!hasReferenceOrMappingType() || isStateVariable() || isEventParameter())
- return set<Location>{ Location::Default };
+ return set<Location>{ Location::Unspecified };
else if (isStateVariable() && isConstant())
return set<Location>{ Location::Memory };
else if (isExternalCallableParameter())
@@ -546,7 +546,7 @@ set<VariableDeclaration::Location> VariableDeclaration::allowedDataLocations() c
}
else
// Struct members etc.
- return set<Location>{ Location::Default };
+ return set<Location>{ Location::Unspecified };
}
TypePointer VariableDeclaration::type() const
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h
index b953211d..a5cd277d 100644
--- a/libsolidity/ast/AST.h
+++ b/libsolidity/ast/AST.h
@@ -655,7 +655,7 @@ private:
class VariableDeclaration: public Declaration
{
public:
- enum Location { Default, Storage, Memory, CallData };
+ enum Location { Unspecified, Storage, Memory, CallData };
VariableDeclaration(
SourceLocation const& _sourceLocation,
@@ -666,7 +666,7 @@ public:
bool _isStateVar = false,
bool _isIndexed = false,
bool _isConstant = false,
- Location _referenceLocation = Location::Default
+ Location _referenceLocation = Location::Unspecified
):
Declaration(_sourceLocation, _name, _visibility),
m_typeName(_type),
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index 72b20b3b..beab356c 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -739,7 +739,7 @@ string ASTJsonConverter::location(VariableDeclaration::Location _location)
{
switch (_location)
{
- case VariableDeclaration::Location::Default:
+ case VariableDeclaration::Location::Unspecified:
return "default";
case VariableDeclaration::Location::Storage:
return "storage";
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index 0bee2a91..bfa0ad24 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -564,7 +564,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
bool isIndexed = false;
bool isDeclaredConst = false;
Declaration::Visibility visibility(Declaration::Visibility::Default);
- VariableDeclaration::Location location = VariableDeclaration::Location::Default;
+ VariableDeclaration::Location location = VariableDeclaration::Location::Unspecified;
ASTPointer<ASTString> identifier;
while (true)
@@ -592,7 +592,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
isDeclaredConst = true;
else if (_options.allowLocationSpecifier && Token::isLocationSpecifier(token))
{
- if (location != VariableDeclaration::Location::Default)
+ if (location != VariableDeclaration::Location::Unspecified)
parserError(string("Location already specified."));
else if (!type)
parserError(string("Location specifier needs explicit type name."));