File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -607,8 +607,8 @@ bool SILValueOwnershipChecker::checkYieldWithoutLifetimeEndingUses(
607
607
608
608
bool SILValueOwnershipChecker::checkValueWithoutLifetimeEndingUses (
609
609
ArrayRef<Operand *> regularUses, ArrayRef<Operand *> extendLifetimeUses) {
610
- if (extendLifetimeUses. size ()) {
611
- }
610
+ if (value-> getOwnershipKind () == OwnershipKind::None)
611
+ return true ;
612
612
613
613
LLVM_DEBUG (llvm::dbgs () << " No lifetime ending users?! Bailing early.\n " );
614
614
if (auto *arg = dyn_cast<SILFunctionArgument>(value)) {
Original file line number Diff line number Diff line change @@ -2702,14 +2702,18 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
2702
2702
}
2703
2703
2704
2704
void checkExtendLifetimeInst (ExtendLifetimeInst *I) {
2705
- require (!I->getOperand ()->getType ().isTrivial (*I->getFunction ())
2706
- || F.getModule ().getStage () == SILStage::Raw,
2707
- " Source value should be non-trivial after diagnostics" );
2708
2705
require (F.hasOwnership (),
2709
2706
" extend_lifetime is only valid in functions with qualified "
2710
2707
" ownership" );
2708
+ // In Raw SIL, extend_lifetime marks the end of variable scopes.
2709
+ if (F.getModule ().getStage () == SILStage::Raw)
2710
+ return ;
2711
+
2712
+ require (!I->getOperand ()->getType ().isTrivial (*I->getFunction ()),
2713
+ " Source value should be non-trivial after diagnostics" );
2711
2714
require (getDeadEndBlocks ().isDeadEnd (I->getParent ()),
2712
- " extend_lifetime in non-dead-end!?" );
2715
+ " extend_lifetime in non-dead-end after diagnostics" );
2716
+
2713
2717
auto value = I->getOperand ();
2714
2718
LinearLiveness linearLiveness (value,
2715
2719
LinearLiveness::DoNotIncludeExtensions);
You can’t perform that action at this time.
0 commit comments