mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/master' into master-next
This commit is contained in:
@@ -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
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user