[semantic-sil] Update FunctionSignatureOpts to propagate forward the correct ValueOwnershipKind into FunctionSignatureOpts.

rdar://29791263
This commit is contained in:
Michael Gottesman
2017-01-09 13:19:50 -08:00
parent 5dea7ea07f
commit 31309f436b
3 changed files with 22 additions and 5 deletions

View File

@@ -125,6 +125,17 @@ struct ArgumentDescriptor {
size_t explosionSize = ProjTree.liveLeafCount();
return explosionSize >= 1 && explosionSize <= 3;
}
llvm::Optional<ValueOwnershipKind>
getTransformedOwnershipKind(SILType SubTy) {
if (IsEntirelyDead)
return None;
if (SubTy.isTrivial(Arg->getModule()))
return Optional<ValueOwnershipKind>(ValueOwnershipKind::Trivial);
if (OwnedToGuaranteed)
return Optional<ValueOwnershipKind>(ValueOwnershipKind::Guaranteed);
return Arg->getOwnershipKind();
}
};
/// A structure that maintains all of the information about a specific