@@ -669,9 +669,6 @@ void SILInstruction::verifyOperandOwnership() const {
669669      continue ;
670670    SILValue opValue = op.get ();
671671
672-     //  Skip any SILUndef that we see.
673-     if  (isa<SILUndef>(opValue))
674-       continue ;
675672    auto  operandOwnershipKindMap = op.getOwnershipKindMap ();
676673    auto  valueOwnershipKind = opValue.getOwnershipKind ();
677674    if  (operandOwnershipKindMap.canAcceptKind (valueOwnershipKind))
@@ -702,11 +699,6 @@ void SILValue::verifyOwnership(SILModule &mod,
702699  if  (DisableOwnershipVerification)
703700    return ;
704701
705-   //  If we are SILUndef, just bail. SILUndef can pair with anything. Any uses of
706-   //  the SILUndef will make sure that the matching checks out.
707-   if  (isa<SILUndef>(*this ))
708-     return ;
709- 
710702  //  Since we do not have SILUndef, we now know that getFunction() should return
711703  //  a real function. Assert in case this assumption is no longer true.
712704  SILFunction *f = (*this )->getFunction ();
@@ -717,6 +709,8 @@ void SILValue::verifyOwnership(SILModule &mod,
717709  if  (!f->hasQualifiedOwnership () || !f->shouldVerifyOwnership ())
718710    return ;
719711
712+   assert (getOwnershipKind () != ValueOwnershipKind::Any &&
713+          " No values should have any ownership anymore"  );
720714  ErrorBehaviorKind errorBehavior;
721715  if  (IsSILOwnershipVerifierTestingEnabled) {
722716    errorBehavior = ErrorBehaviorKind::PrintMessageAndReturnFalse;
@@ -743,11 +737,6 @@ bool OwnershipChecker::checkValue(SILValue value) {
743737  lifetimeEndingUsers.clear ();
744738  liveBlocks.clear ();
745739
746-   //  If we are SILUndef, just bail. SILUndef can pair with anything. Any uses of
747-   //  the SILUndef will make sure that the matching checks out.
748-   if  (isa<SILUndef>(value))
749-     return  false ;
750- 
751740  //  Since we do not have SILUndef, we now know that getFunction() should return
752741  //  a real function. Assert in case this assumption is no longer true.
753742  SILFunction *f = value->getFunction ();
0 commit comments