Merge pull request #72777 from atrick/fix-lifedep-throw

LifetimeDependence: handle dependent values in throwing calls.
This commit is contained in:
Andrew Trick
2024-04-04 08:06:31 -07:00
committed by GitHub
13 changed files with 137 additions and 24 deletions

View File

@@ -8679,6 +8679,11 @@ class DestroyValueInst
}
public:
/// True if this destroy fully deinitializes the type by invoking the
/// user-defined deinitializer if present. This returns false if a prior
/// drop_deinit is present.
bool isFullDeinitialization();
/// If true, then all references within the destroyed value will be
/// overwritten with a sentinel. This is used in debug builds when shortening
/// non-trivial value lifetimes to ensure the debugger cannot inspect invalid
@@ -8749,11 +8754,12 @@ public:
/// for details. See SILVerifier.cpp for constraints on valid uses.
class DropDeinitInst
: public UnaryInstructionBase<SILInstructionKind::DropDeinitInst,
SingleValueInstruction> {
OwnershipForwardingSingleValueInstruction> {
friend class SILBuilder;
DropDeinitInst(SILDebugLocation DebugLoc, SILValue operand)
: UnaryInstructionBase(DebugLoc, operand, operand->getType()) {}
: UnaryInstructionBase(DebugLoc, operand, operand->getType(),
OwnershipKind::Owned) {}
};
/// Equivalent to a copy_addr to [init] except that it is used for diagnostics
@@ -11134,6 +11140,7 @@ OwnershipForwardingSingleValueInstruction::classof(SILInstructionKind kind) {
case SILInstructionKind::ThinToThickFunctionInst:
case SILInstructionKind::UnconditionalCheckedCastInst:
case SILInstructionKind::FunctionExtractIsolationInst:
case SILInstructionKind::DropDeinitInst:
return true;
default:
return false;