Use a meaningful representation of parameter specifiers

In anticipation of future attributes, and perhaps the ability to
declare lvalues with specifiers other than 'let' and 'var', expand
the "isLet" bit into a more general "specifier" field.
This commit is contained in:
Robert Widmann
2017-06-28 13:38:36 -07:00
parent 04bc382e1c
commit ac5594dabe
29 changed files with 229 additions and 132 deletions

View File

@@ -74,7 +74,7 @@ static void deriveRawValueInit(AbstractFunctionDecl *initDecl) {
DeclNameLoc(), /*Implicit=*/true);
// rawValue param to init(rawValue:)
auto *rawValueDecl = new (C) ParamDecl(/*IsLet=*/true, SourceLoc(),
auto *rawValueDecl = new (C) ParamDecl(VarDecl::Specifier::None, SourceLoc(),
SourceLoc(), C.Id_rawValue,
SourceLoc(), C.Id_rawValue,
valueParam->getType(), parentDC);
@@ -124,7 +124,7 @@ static ValueDecl *deriveInitDecl(TypeChecker &tc, Decl *parentDecl,
auto *parentDC = cast<DeclContext>(parentDecl);
// rawValue
auto *rawDecl = new (C) ParamDecl(/*IsLet*/ true, SourceLoc(), SourceLoc(),
auto *rawDecl = new (C) ParamDecl(VarDecl::Specifier::None, SourceLoc(), SourceLoc(),
paramName, SourceLoc(), paramName,
paramType, parentDC);
rawDecl->setInterfaceType(paramType);