@@ -517,7 +517,7 @@ class LocalVariableInitialization : public SingleBufferInitialization {
517
517
518
518
// If we have a no implicit copy param decl, make our instance type
519
519
// @moveOnly.
520
- if (!instanceType->isPureMoveOnly ()) {
520
+ if (!instanceType->isNoncopyable ()) {
521
521
if (auto *pd = dyn_cast<ParamDecl>(decl)) {
522
522
bool isNoImplicitCopy = pd->isNoImplicitCopy();
523
523
isNoImplicitCopy |= pd->getSpecifier() == ParamSpecifier::Consuming;
@@ -535,7 +535,7 @@ class LocalVariableInitialization : public SingleBufferInitialization {
535
535
536
536
auto boxType = SGF.SGM.Types.getContextBoxTypeForCapture(
537
537
decl, instanceType, SGF.F.getGenericEnvironment(),
538
- /*mutable*/ !instanceType->isPureMoveOnly () || !decl->isLet());
538
+ /*mutable*/ !instanceType->isNoncopyable () || !decl->isLet());
539
539
540
540
// The variable may have its lifetime extended by a closure, heap-allocate
541
541
// it using a box.
@@ -689,7 +689,7 @@ class LetValueInitialization : public Initialization {
689
689
// For noncopyable types, we always need to box them.
690
690
needsTemporaryBuffer =
691
691
(lowering->isAddressOnly() && SGF.silConv.useLoweredAddresses()) ||
692
- lowering->getLoweredType().isPureMoveOnly ();
692
+ lowering->getLoweredType().getASTType()->isNoncopyable ();
693
693
}
694
694
695
695
// Make sure that we have a non-address only type when binding a
@@ -774,7 +774,7 @@ class LetValueInitialization : public Initialization {
774
774
if (value->getOwnershipKind() == OwnershipKind::None) {
775
775
// Then check if we have a pure move only type. In that case, we need to
776
776
// insert a no implicit copy
777
- if (value->getType().isPureMoveOnly ()) {
777
+ if (value->getType().getASTType()->isNoncopyable ()) {
778
778
value = SGF.B.createMoveValue(PrologueLoc, value, /*isLexical*/ true);
779
779
return SGF.B.createMarkUnresolvedNonCopyableValueInst(
780
780
PrologueLoc, value,
@@ -824,7 +824,7 @@ class LetValueInitialization : public Initialization {
824
824
// We do this before the begin_borrow "normal" path below since move only
825
825
// types do not have no implicit copy attr on them.
826
826
if (value->getOwnershipKind() == OwnershipKind::Owned &&
827
- value->getType().isPureMoveOnly ()) {
827
+ value->getType().getASTType()->isNoncopyable ()) {
828
828
value = SGF.B.createMoveValue(PrologueLoc, value, true /*isLexical*/);
829
829
return SGF.B.createMarkUnresolvedNonCopyableValueInst(
830
830
PrologueLoc, value,
@@ -1455,7 +1455,7 @@ SILGenFunction::emitInitializationForVarDecl(VarDecl *vd, bool forceImmutable,
1455
1455
// If this is a 'let' initialization for a copyable non-global, set up a let
1456
1456
// binding, which stores the initialization value into VarLocs directly.
1457
1457
if (forceImmutable && vd->getDeclContext()->isLocalContext() &&
1458
- !isa<ReferenceStorageType>(varType) && !varType->isPureMoveOnly ())
1458
+ !isa<ReferenceStorageType>(varType) && !varType->isNoncopyable ())
1459
1459
return InitializationPtr(new LetValueInitialization(vd, *this));
1460
1460
1461
1461
// If the variable has no initial value, emit a mark_uninitialized instruction
0 commit comments