Switch a pile of VarDecl::Specifier::Owneds to ::Default.

A lot of these probably should be Owned, but deciding that is work for
another time.
This commit is contained in:
Huon Wilson
2018-03-07 13:15:12 +11:00
parent 38029bab2a
commit b1115af1eb
9 changed files with 48 additions and 60 deletions

View File

@@ -484,9 +484,9 @@ static CallExpr *createContainerKeyedByCall(ASTContext &C, DeclContext *DC,
Expr *base, Type returnType,
NominalTypeDecl *param) {
// (keyedBy:)
auto *keyedByDecl = new (C) ParamDecl(VarDecl::Specifier::Owned, SourceLoc(),
SourceLoc(), C.Id_keyedBy, SourceLoc(),
C.Id_keyedBy, returnType, DC);
auto *keyedByDecl = new (C)
ParamDecl(VarDecl::Specifier::Default, SourceLoc(), SourceLoc(),
C.Id_keyedBy, SourceLoc(), C.Id_keyedBy, returnType, DC);
keyedByDecl->setImplicit();
keyedByDecl->setInterfaceType(returnType);
@@ -727,9 +727,9 @@ static FuncDecl *deriveEncodable_encode(TypeChecker &tc, Decl *parentDecl,
// Params: (self [implicit], Encoder)
auto *selfDecl = ParamDecl::createSelf(SourceLoc(), target);
auto *encoderParam = new (C) ParamDecl(VarDecl::Specifier::Owned, SourceLoc(),
SourceLoc(), C.Id_to, SourceLoc(),
C.Id_encoder, encoderType, target);
auto *encoderParam = new (C)
ParamDecl(VarDecl::Specifier::Default, SourceLoc(), SourceLoc(), C.Id_to,
SourceLoc(), C.Id_encoder, encoderType, target);
encoderParam->setInterfaceType(encoderType);
ParameterList *params[] = {ParameterList::createWithoutLoc(selfDecl),
@@ -1065,11 +1065,9 @@ static ValueDecl *deriveDecodable_init(TypeChecker &tc, Decl *parentDecl,
auto *selfDecl = ParamDecl::createSelf(SourceLoc(), target,
/*isStatic=*/false,
/*isInOut=*/inOut);
auto *decoderParamDecl = new (C) ParamDecl(VarDecl::Specifier::Owned,
SourceLoc(),
SourceLoc(), C.Id_from,
SourceLoc(), C.Id_decoder,
decoderType, target);
auto *decoderParamDecl = new (C)
ParamDecl(VarDecl::Specifier::Default, SourceLoc(), SourceLoc(),
C.Id_from, SourceLoc(), C.Id_decoder, decoderType, target);
decoderParamDecl->setImplicit();
decoderParamDecl->setInterfaceType(decoderType);