@@ -246,7 +246,7 @@ CONSTANT_OR_NONE_OWNERSHIP_INST(Owned, LifetimeEnding, DeinitExistentialValue)
246
246
#define ACCEPTS_ANY_OWNERSHIP_INST (INST ) \
247
247
OwnershipConstraint OwnershipConstraintClassifier::visit##INST##Inst( \
248
248
INST##Inst *i) { \
249
- return OwnershipConstraint::anyValueAcceptingConstraint (); \
249
+ return OwnershipConstraint::any (); \
250
250
}
251
251
ACCEPTS_ANY_OWNERSHIP_INST (BeginBorrow)
252
252
ACCEPTS_ANY_OWNERSHIP_INST(CopyValue)
@@ -342,13 +342,13 @@ OwnershipConstraint OwnershipConstraintClassifier::visitDeallocPartialRefInst(
342
342
return {OwnershipKind::Owned, UseLifetimeConstraint::LifetimeEnding};
343
343
}
344
344
345
- return OwnershipConstraint::anyValueAcceptingConstraint ();
345
+ return OwnershipConstraint::any ();
346
346
}
347
347
348
348
OwnershipConstraint
349
349
OwnershipConstraintClassifier::visitSelectEnumInst (SelectEnumInst *i) {
350
350
if (getValue () == i->getEnumOperand ()) {
351
- return OwnershipConstraint::anyValueAcceptingConstraint ();
351
+ return OwnershipConstraint::any ();
352
352
}
353
353
354
354
auto kind = i->getOwnershipKind ();
@@ -360,14 +360,14 @@ OwnershipConstraint
360
360
OwnershipConstraintClassifier::visitAllocRefInst (AllocRefInst *i) {
361
361
assert (i->getNumOperands () != 0 &&
362
362
" If we reach this point, we must have a tail operand" );
363
- return OwnershipConstraint::anyValueAcceptingConstraint ();
363
+ return OwnershipConstraint::any ();
364
364
}
365
365
366
366
OwnershipConstraint OwnershipConstraintClassifier::visitAllocRefDynamicInst (
367
367
AllocRefDynamicInst *i) {
368
368
assert (i->getNumOperands () != 0 &&
369
369
" If we reach this point, we must have a tail operand" );
370
- return OwnershipConstraint::anyValueAcceptingConstraint ();
370
+ return OwnershipConstraint::any ();
371
371
}
372
372
373
373
OwnershipConstraint
@@ -401,7 +401,7 @@ OwnershipConstraint
401
401
OwnershipConstraintClassifier::visitCondBranchInst (CondBranchInst *cbi) {
402
402
// In ossa, cond_br insts are not allowed to take non-trivial values. Thus, we
403
403
// just accept anything since we know all of our operands will be trivial.
404
- return OwnershipConstraint::anyValueAcceptingConstraint ();
404
+ return OwnershipConstraint::any ();
405
405
}
406
406
407
407
OwnershipConstraint
@@ -444,7 +444,7 @@ OwnershipConstraintClassifier::visitThrowInst(ThrowInst *i) {
444
444
/* but it does not touch the strong reference count of the value. We */ \
445
445
/* also just care about liveness for the dest. So just match everything */ \
446
446
/* as must be live. */ \
447
- return OwnershipConstraint::anyValueAcceptingConstraint (); \
447
+ return OwnershipConstraint::any (); \
448
448
}
449
449
#define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE (Name, ...) \
450
450
NEVER_LOADABLE_CHECKED_REF_STORAGE (Name, " ..." )
@@ -456,7 +456,7 @@ OwnershipConstraintClassifier::visitStoreBorrowInst(StoreBorrowInst *i) {
456
456
return {OwnershipKind::Guaranteed,
457
457
UseLifetimeConstraint::NonLifetimeEnding};
458
458
}
459
- return OwnershipConstraint::anyValueAcceptingConstraint ();
459
+ return OwnershipConstraint::any ();
460
460
}
461
461
462
462
// FIXME: Why not use SILArgumentConvention here?
@@ -478,12 +478,12 @@ OwnershipConstraintClassifier::visitCallee(CanSILFunctionType substCalleeType) {
478
478
case ParameterConvention::Indirect_InoutAliasable:
479
479
llvm_unreachable (" Illegal convention for callee" );
480
480
case ParameterConvention::Direct_Unowned:
481
- return OwnershipConstraint::anyValueAcceptingConstraint ();
481
+ return OwnershipConstraint::any ();
482
482
case ParameterConvention::Direct_Owned:
483
483
return {OwnershipKind::Owned, UseLifetimeConstraint::LifetimeEnding};
484
484
case ParameterConvention::Direct_Guaranteed:
485
485
if (substCalleeType->isNoEscape ())
486
- return OwnershipConstraint::anyValueAcceptingConstraint ();
486
+ return OwnershipConstraint::any ();
487
487
return {OwnershipKind::Guaranteed,
488
488
UseLifetimeConstraint::NonLifetimeEnding};
489
489
}
@@ -509,7 +509,7 @@ OwnershipConstraintClassifier::visitFullApply(FullApplySite apply) {
509
509
510
510
// Indirect return arguments are address types.
511
511
if (apply.isIndirectResultOperand (op)) {
512
- return OwnershipConstraint::anyValueAcceptingConstraint ();
512
+ return OwnershipConstraint::any ();
513
513
}
514
514
515
515
// We should have early exited if we saw a type dependent operand, so we
@@ -527,12 +527,12 @@ OwnershipConstraintClassifier::visitFullApply(FullApplySite apply) {
527
527
return visitApplyParameter (OwnershipKind::Owned,
528
528
UseLifetimeConstraint::LifetimeEnding);
529
529
case ParameterConvention::Direct_Unowned:
530
- return OwnershipConstraint::anyValueAcceptingConstraint ();
530
+ return OwnershipConstraint::any ();
531
531
532
532
case ParameterConvention::Indirect_In: {
533
533
// This expects an @trivial if we have lowered addresses and @
534
534
if (conv.useLoweredAddresses ()) {
535
- return OwnershipConstraint::anyValueAcceptingConstraint ();
535
+ return OwnershipConstraint::any ();
536
536
}
537
537
// TODO: Once trivial is subsumed in any, this goes away.
538
538
auto map = visitApplyParameter (OwnershipKind::Owned,
@@ -543,7 +543,7 @@ OwnershipConstraintClassifier::visitFullApply(FullApplySite apply) {
543
543
case ParameterConvention::Indirect_In_Guaranteed: {
544
544
// This expects an @trivial if we have lowered addresses and @
545
545
if (conv.useLoweredAddresses ()) {
546
- return OwnershipConstraint::anyValueAcceptingConstraint ();
546
+ return OwnershipConstraint::any ();
547
547
}
548
548
return visitApplyParameter (OwnershipKind::Guaranteed,
549
549
UseLifetimeConstraint::NonLifetimeEnding);
@@ -554,7 +554,7 @@ OwnershipConstraintClassifier::visitFullApply(FullApplySite apply) {
554
554
case ParameterConvention::Indirect_In_Constant:
555
555
case ParameterConvention::Indirect_Inout:
556
556
case ParameterConvention::Indirect_InoutAliasable:
557
- return OwnershipConstraint::anyValueAcceptingConstraint ();
557
+ return OwnershipConstraint::any ();
558
558
559
559
case ParameterConvention::Direct_Guaranteed:
560
560
// A +1 value may be passed to a guaranteed argument. From the caller's
@@ -586,7 +586,7 @@ OwnershipConstraint
586
586
OwnershipConstraintClassifier::visitPartialApplyInst (PartialApplyInst *i) {
587
587
// partial_apply [stack] does not take ownership of its operands.
588
588
if (i->isOnStack ())
589
- return OwnershipConstraint::anyValueAcceptingConstraint ();
589
+ return OwnershipConstraint::any ();
590
590
591
591
// All non-trivial types should be captured.
592
592
return {OwnershipKind::Owned, UseLifetimeConstraint::LifetimeEnding};
@@ -599,7 +599,7 @@ OwnershipConstraintClassifier::visitYieldInst(YieldInst *i) {
599
599
//
600
600
// TODO: Change this to check if this operand is an indirect result
601
601
if (isAddressOrTrivialType ())
602
- return OwnershipConstraint::anyValueAcceptingConstraint ();
602
+ return OwnershipConstraint::any ();
603
603
604
604
auto fnType = i->getFunction ()->getLoweredFunctionType ();
605
605
auto yieldInfo = fnType->getYields ()[getOperandIndex ()];
@@ -611,7 +611,7 @@ OwnershipConstraintClassifier::visitYieldInst(YieldInst *i) {
611
611
case ParameterConvention::Indirect_In_Constant:
612
612
case ParameterConvention::Direct_Unowned:
613
613
// We accept unowned, owned, and guaranteed in unowned positions.
614
- return OwnershipConstraint::anyValueAcceptingConstraint ();
614
+ return OwnershipConstraint::any ();
615
615
case ParameterConvention::Indirect_In_Guaranteed:
616
616
case ParameterConvention::Direct_Guaranteed:
617
617
return visitApplyParameter (OwnershipKind::Guaranteed,
@@ -627,7 +627,7 @@ OwnershipConstraintClassifier::visitYieldInst(YieldInst *i) {
627
627
OwnershipConstraint
628
628
OwnershipConstraintClassifier::visitAssignInst (AssignInst *i) {
629
629
if (getValue () != i->getSrc ()) {
630
- return OwnershipConstraint::anyValueAcceptingConstraint ();
630
+ return OwnershipConstraint::any ();
631
631
}
632
632
633
633
return {OwnershipKind::Owned, UseLifetimeConstraint::LifetimeEnding};
@@ -636,7 +636,7 @@ OwnershipConstraintClassifier::visitAssignInst(AssignInst *i) {
636
636
OwnershipConstraint OwnershipConstraintClassifier::visitAssignByWrapperInst (
637
637
AssignByWrapperInst *i) {
638
638
if (getValue () != i->getSrc ()) {
639
- return OwnershipConstraint::anyValueAcceptingConstraint ();
639
+ return OwnershipConstraint::any ();
640
640
}
641
641
642
642
return {OwnershipKind::Owned, UseLifetimeConstraint::LifetimeEnding};
@@ -645,7 +645,7 @@ OwnershipConstraint OwnershipConstraintClassifier::visitAssignByWrapperInst(
645
645
OwnershipConstraint
646
646
OwnershipConstraintClassifier::visitStoreInst (StoreInst *i) {
647
647
if (getValue () != i->getSrc ()) {
648
- return OwnershipConstraint::anyValueAcceptingConstraint ();
648
+ return OwnershipConstraint::any ();
649
649
}
650
650
651
651
return {OwnershipKind::Owned, UseLifetimeConstraint::LifetimeEnding};
@@ -659,7 +659,7 @@ OwnershipConstraintClassifier::visitCopyBlockWithoutEscapingInst(
659
659
return {OwnershipKind::Owned, UseLifetimeConstraint::LifetimeEnding};
660
660
}
661
661
662
- return OwnershipConstraint::anyValueAcceptingConstraint ();
662
+ return OwnershipConstraint::any ();
663
663
}
664
664
665
665
OwnershipConstraint OwnershipConstraintClassifier::visitMarkDependenceInst (
@@ -668,7 +668,7 @@ OwnershipConstraint OwnershipConstraintClassifier::visitMarkDependenceInst(
668
668
if (getValue () == mdi->getValue ()) {
669
669
auto kind = mdi->getOwnershipKind ();
670
670
if (kind == OwnershipKind::None)
671
- return OwnershipConstraint::anyValueAcceptingConstraint ();
671
+ return OwnershipConstraint::any ();
672
672
auto lifetimeConstraint = kind.getForwardingLifetimeConstraint ();
673
673
return {kind, lifetimeConstraint};
674
674
}
@@ -677,7 +677,7 @@ OwnershipConstraint OwnershipConstraintClassifier::visitMarkDependenceInst(
677
677
// "base". This means that any use that would destroy "value" can not be moved
678
678
// before any uses of "base". We treat this as non-consuming and rely on the
679
679
// rest of the optimizer to respect the movement restrictions.
680
- return OwnershipConstraint::anyValueAcceptingConstraint ();
680
+ return OwnershipConstraint::any ();
681
681
}
682
682
683
683
OwnershipConstraint
@@ -702,7 +702,7 @@ struct OperandOwnershipKindBuiltinClassifier
702
702
llvm::Intrinsic::ID id) {
703
703
// LLVM intrinsics do not traffic in ownership, so if we have a result, it
704
704
// must be trivial.
705
- return OwnershipConstraint::anyValueAcceptingConstraint ();
705
+ return OwnershipConstraint::any ();
706
706
}
707
707
708
708
// BUILTIN_TYPE_CHECKER_OPERATION does not live past the type checker.
@@ -720,7 +720,7 @@ struct OperandOwnershipKindBuiltinClassifier
720
720
#define ANY_OWNERSHIP_BUILTIN (ID ) \
721
721
OwnershipConstraint OperandOwnershipKindBuiltinClassifier::visit##ID( \
722
722
BuiltinInst *, StringRef) { \
723
- return OwnershipConstraint::anyValueAcceptingConstraint (); \
723
+ return OwnershipConstraint::any (); \
724
724
}
725
725
ANY_OWNERSHIP_BUILTIN (ErrorInMain)
726
726
ANY_OWNERSHIP_BUILTIN(UnexpectedError)
0 commit comments