@@ -611,7 +611,7 @@ namespace {
611611 /* invocation subs*/ SubstitutionMap (), IGF.IGM .Context );
612612 }
613613
614- void emitCopyWithCopyOrMoveConstructor (
614+ void emitCopyWithCopyConstructor (
615615 IRGenFunction &IGF, SILType T,
616616 const clang::CXXConstructorDecl *copyConstructor, llvm::Value *src,
617617 llvm::Value *dest) const {
@@ -625,21 +625,12 @@ namespace {
625625 if (copyConstructor->isDefaulted () &&
626626 copyConstructor->getAccess () == clang::AS_public &&
627627 !copyConstructor->isDeleted () &&
628- !copyConstructor->isIneligibleOrNotSelected () &&
629628 // Note: we use "doesThisDeclarationHaveABody" here because
630629 // that's what "DefineImplicitCopyConstructor" checks.
631630 !copyConstructor->doesThisDeclarationHaveABody ()) {
632- assert (!copyConstructor->getParent ()->isAnonymousStructOrUnion () &&
633- " Cannot do codegen of special member functions of anonymous "
634- " structs/unions" );
635- if (copyConstructor->isCopyConstructor ())
636- importer->getClangSema ().DefineImplicitCopyConstructor (
637- clang::SourceLocation (),
638- const_cast <clang::CXXConstructorDecl *>(copyConstructor));
639- else
640- importer->getClangSema ().DefineImplicitMoveConstructor (
641- clang::SourceLocation (),
642- const_cast <clang::CXXConstructorDecl *>(copyConstructor));
631+ importer->getClangSema ().DefineImplicitCopyConstructor (
632+ clang::SourceLocation (),
633+ const_cast <clang::CXXConstructorDecl *>(copyConstructor));
643634 }
644635
645636 auto &diagEngine = importer->getClangSema ().getDiagnostics ();
@@ -821,9 +812,9 @@ namespace {
821812 Address srcAddr, SILType T,
822813 bool isOutlined) const override {
823814 if (auto copyConstructor = findCopyConstructor ()) {
824- emitCopyWithCopyOrMoveConstructor (IGF, T, copyConstructor,
825- srcAddr.getAddress (),
826- destAddr.getAddress ());
815+ emitCopyWithCopyConstructor (IGF, T, copyConstructor,
816+ srcAddr.getAddress (),
817+ destAddr.getAddress ());
827818 return ;
828819 }
829820 StructTypeInfoBase<AddressOnlyCXXClangRecordTypeInfo, FixedTypeInfo,
@@ -836,9 +827,9 @@ namespace {
836827 SILType T, bool isOutlined) const override {
837828 if (auto copyConstructor = findCopyConstructor ()) {
838829 destroy (IGF, destAddr, T, isOutlined);
839- emitCopyWithCopyOrMoveConstructor (IGF, T, copyConstructor,
840- srcAddr.getAddress (),
841- destAddr.getAddress ());
830+ emitCopyWithCopyConstructor (IGF, T, copyConstructor,
831+ srcAddr.getAddress (),
832+ destAddr.getAddress ());
842833 return ;
843834 }
844835 StructTypeInfoBase<AddressOnlyCXXClangRecordTypeInfo, FixedTypeInfo,
@@ -850,15 +841,17 @@ namespace {
850841 SILType T, bool isOutlined,
851842 bool zeroizeIfSensitive) const override {
852843 if (auto moveConstructor = findMoveConstructor ()) {
853- emitCopyWithCopyOrMoveConstructor (IGF, T, moveConstructor,
854- src.getAddress (), dest.getAddress ());
844+ emitCopyWithCopyConstructor (IGF, T, moveConstructor,
845+ src.getAddress (),
846+ dest.getAddress ());
855847 destroy (IGF, src, T, isOutlined);
856848 return ;
857849 }
858850
859851 if (auto copyConstructor = findCopyConstructor ()) {
860- emitCopyWithCopyOrMoveConstructor (IGF, T, copyConstructor,
861- src.getAddress (), dest.getAddress ());
852+ emitCopyWithCopyConstructor (IGF, T, copyConstructor,
853+ src.getAddress (),
854+ dest.getAddress ());
862855 destroy (IGF, src, T, isOutlined);
863856 return ;
864857 }
@@ -872,16 +865,18 @@ namespace {
872865 bool isOutlined) const override {
873866 if (auto moveConstructor = findMoveConstructor ()) {
874867 destroy (IGF, dest, T, isOutlined);
875- emitCopyWithCopyOrMoveConstructor (IGF, T, moveConstructor,
876- src.getAddress (), dest.getAddress ());
868+ emitCopyWithCopyConstructor (IGF, T, moveConstructor,
869+ src.getAddress (),
870+ dest.getAddress ());
877871 destroy (IGF, src, T, isOutlined);
878872 return ;
879873 }
880874
881875 if (auto copyConstructor = findCopyConstructor ()) {
882876 destroy (IGF, dest, T, isOutlined);
883- emitCopyWithCopyOrMoveConstructor (IGF, T, copyConstructor,
884- src.getAddress (), dest.getAddress ());
877+ emitCopyWithCopyConstructor (IGF, T, copyConstructor,
878+ src.getAddress (),
879+ dest.getAddress ());
885880 destroy (IGF, src, T, isOutlined);
886881 return ;
887882 }
0 commit comments