Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
swift-ci
2017-09-15 13:29:49 -07:00
73 changed files with 3739 additions and 642 deletions

View File

@@ -449,8 +449,6 @@ NO_OPERAND_INST(StrongRetain)
NO_OPERAND_INST(StrongRetainUnowned)
NO_OPERAND_INST(UnownedRetain)
NO_OPERAND_INST(Unreachable)
// TODO: Some key path components will have operands
NO_OPERAND_INST(KeyPath)
#undef NO_OPERAND_INST
/// Instructions whose arguments are always compatible with one convention.
@@ -1144,6 +1142,18 @@ OwnershipCompatibilityUseChecker::visitMarkDependenceInst(
return {true, UseLifetimeConstraint::MustBeLive};
}
OwnershipUseCheckerResult
OwnershipCompatibilityUseChecker::visitKeyPathInst(KeyPathInst *I) {
// KeyPath moves the value in memory out of address operands, but the
// ownership checker doesn't reason about that yet.
if (isAddressOrTrivialType()) {
return {compatibleWithOwnership(ValueOwnershipKind::Trivial),
UseLifetimeConstraint::MustBeLive};
}
return {compatibleWithOwnership(ValueOwnershipKind::Owned),
UseLifetimeConstraint::MustBeInvalidated};
}
//===----------------------------------------------------------------------===//
// Builtin Use Checker
//===----------------------------------------------------------------------===//