@@ -450,7 +450,7 @@ class LetValueInitialization : public Initialization {
450
450
LetValueInitialization (VarDecl *vd, SILGenFunction &SGF) : vd(vd) {
451
451
const TypeLowering *lowering = nullptr ;
452
452
if (SGF.getASTContext ().LangOpts .Features .count (Feature::MoveOnly) &&
453
- vd->getAttrs (). hasAttribute <NoImplicitCopyAttr> ()) {
453
+ vd->isNoImplicitCopy ()) {
454
454
lowering = &SGF.getTypeLowering (
455
455
SILMoveOnlyWrappedType::get (vd->getType ()->getCanonicalType ()));
456
456
} else {
@@ -487,8 +487,7 @@ class LetValueInitialization : public Initialization {
487
487
// Make sure that we have a non-address only type when binding a
488
488
// @_noImplicitCopy let.
489
489
if (SGF.getASTContext ().LangOpts .Features .count (Feature::MoveOnly) &&
490
- lowering->isAddressOnly () &&
491
- vd->getAttrs ().hasAttribute <NoImplicitCopyAttr>()) {
490
+ lowering->isAddressOnly () && vd->isNoImplicitCopy ()) {
492
491
auto d = diag::noimplicitcopy_used_on_generic_or_existential;
493
492
diagnose (SGF.getASTContext (), vd->getLoc (), d);
494
493
}
@@ -569,8 +568,7 @@ class LetValueInitialization : public Initialization {
569
568
// ... and we don't have a no implicit copy trivial type, just return
570
569
// value.
571
570
if (!SGF.getASTContext ().LangOpts .Features .count (Feature::MoveOnly) ||
572
- !vd->getAttrs ().hasAttribute <NoImplicitCopyAttr>() ||
573
- !value->getType ().isTrivial (SGF.F ))
571
+ !vd->isNoImplicitCopy () || !value->getType ().isTrivial (SGF.F ))
574
572
return value;
575
573
576
574
// Otherwise, we have a no implicit copy trivial type, so wrap it in the
@@ -626,7 +624,7 @@ class LetValueInitialization : public Initialization {
626
624
627
625
// Otherwise, if we do not have a no implicit copy variable, just follow
628
626
// the "normal path": perform a lexical borrow if the lifetime is lexical.
629
- if (!vd->getAttrs (). hasAttribute <NoImplicitCopyAttr> ()) {
627
+ if (!vd->isNoImplicitCopy ()) {
630
628
if (SGF.F .getLifetime (vd, value->getType ()).isLexical ())
631
629
return SGF.B .createBeginBorrow (PrologueLoc, value, /* isLexical*/ true );
632
630
else
0 commit comments