[AST] Explicitly track things marked __owned.

This commit is contained in:
Huon Wilson
2018-02-27 17:50:11 -08:00
parent ae0027a225
commit e307e54098
48 changed files with 358 additions and 141 deletions

View File

@@ -1369,18 +1369,16 @@ void TypeChecker::completePropertyBehaviorParameter(VarDecl *VD,
assert(interfaceTy);
auto contextTy = declaredParamTy.subst(contextMap);
assert(contextTy);
auto declaredSpecifier = declaredParam->getSpecifier();
SmallString<64> ParamNameBuf;
{
llvm::raw_svector_ostream names(ParamNameBuf);
names << "%arg." << i;
}
auto param = new (Context) ParamDecl(VarDecl::Specifier::Owned,
SourceLoc(), SourceLoc(),
Identifier(),
SourceLoc(),
Context.getIdentifier(ParamNameBuf),
contextTy, DC);
auto param = new (Context) ParamDecl(
declaredSpecifier, SourceLoc(), SourceLoc(), Identifier(), SourceLoc(),
Context.getIdentifier(ParamNameBuf), contextTy, DC);
param->setInterfaceType(interfaceTy);
param->setImplicit();
Params.push_back(param);