@@ -2141,8 +2141,7 @@ namespace {
21412141 }
21422142
21432143 // TODO(https://github.com/apple/swift/issues/56206): Fix this once we support dependent types.
2144- if (decl->getTypeForDecl ()->isDependentType () &&
2145- !Impl.importSymbolicCXXDecls ) {
2144+ if (decl->getTypeForDecl ()->isDependentType ()) {
21462145 Impl.addImportDiagnostic (
21472146 decl, Diagnostic (
21482147 diag::record_is_dependent,
@@ -3068,11 +3067,8 @@ namespace {
30683067 auto semanticsKind = evaluateOrDefault (
30693068 Impl.SwiftContext .evaluator ,
30703069 CxxRecordSemantics ({decl, Impl.SwiftContext , &Impl}), {});
3071- if ((semanticsKind == CxxRecordSemanticsKind::MissingLifetimeOperation ||
3072- semanticsKind == CxxRecordSemanticsKind::UnavailableConstructors) &&
3073- // Let un-specialized class templates through. We'll sort out their
3074- // members once they're instantiated.
3075- !Impl.importSymbolicCXXDecls ) {
3070+ if (semanticsKind == CxxRecordSemanticsKind::MissingLifetimeOperation ||
3071+ semanticsKind == CxxRecordSemanticsKind::UnavailableConstructors) {
30763072
30773073 HeaderLoc loc (decl->getLocation ());
30783074 if (hasUnsafeAPIAttr (decl))
@@ -3267,12 +3263,6 @@ namespace {
32673263
32683264 Decl *VisitClassTemplateSpecializationDecl (
32693265 const clang::ClassTemplateSpecializationDecl *decl) {
3270- // Treat a specific specialization like the unspecialized class template
3271- // when importing it in symbolic mode.
3272- if (Impl.importSymbolicCXXDecls )
3273- return Impl.importDecl (decl->getSpecializedTemplate (),
3274- Impl.CurrentVersion );
3275-
32763266 bool isPair = decl->getSpecializedTemplate ()->isInStdNamespace () &&
32773267 decl->getSpecializedTemplate ()->getName () == " pair" ;
32783268
@@ -3953,8 +3943,6 @@ namespace {
39533943 Impl.SwiftContext , SourceLoc (), templateParams, SourceLoc ());
39543944 }
39553945
3956- bool importFuncWithoutSignature =
3957- isa<clang::CXXMethodDecl>(decl) && Impl.importSymbolicCXXDecls ;
39583946 if (!dc->isModuleScopeContext () && !isClangNamespace (dc) &&
39593947 !isa<clang::CXXMethodDecl>(decl)) {
39603948 // Handle initializers.
@@ -4021,39 +4009,12 @@ namespace {
40214009 importedType =
40224010 Impl.importFunctionReturnType (dc, decl, allowNSUIntegerAsInt);
40234011 } else {
4024- if (importFuncWithoutSignature) {
4025- importedType = ImportedType{Impl.SwiftContext .getVoidType (), false };
4026- if (decl->param_empty ())
4027- bodyParams = ParameterList::createEmpty (Impl.SwiftContext );
4028- else {
4029- llvm::SmallVector<ParamDecl *, 4 > params;
4030- for (const auto ¶m : decl->parameters ()) {
4031-
4032- Identifier bodyName =
4033- Impl.importFullName (param, Impl.CurrentVersion )
4034- .getBaseIdentifier (Impl.SwiftContext );
4035- auto paramInfo = Impl.createDeclWithClangNode <ParamDecl>(
4036- param, AccessLevel::Private, SourceLoc (), SourceLoc (),
4037- Identifier (), Impl.importSourceLoc (param->getLocation ()),
4038- bodyName, Impl.ImportedHeaderUnit );
4039- paramInfo->setSpecifier (ParamSpecifier::Default);
4040- paramInfo->setInterfaceType (Impl.SwiftContext .TheAnyType );
4041- if (param->hasDefaultArg ()) {
4042- paramInfo->setDefaultArgumentKind (DefaultArgumentKind::Normal);
4043- paramInfo->setDefaultValueStringRepresentation (" cxxDefaultArg" );
4044- }
4045- params.push_back (paramInfo);
4046- }
4047- bodyParams = ParameterList::create (Impl.SwiftContext , params);
4048- }
4049- } else {
4050- // Import the function type. If we have parameters, make sure their
4051- // names get into the resulting function type.
4052- importedType = Impl.importFunctionParamsAndReturnType (
4053- dc, decl, {decl->param_begin (), decl->param_size ()},
4054- decl->isVariadic (), isInSystemModule (dc), name, bodyParams,
4055- templateParams);
4056- }
4012+ // Import the function type. If we have parameters, make sure their
4013+ // names get into the resulting function type.
4014+ importedType = Impl.importFunctionParamsAndReturnType (
4015+ dc, decl, {decl->param_begin (), decl->param_size ()},
4016+ decl->isVariadic (), isInSystemModule (dc), name, bodyParams,
4017+ templateParams);
40574018
40584019 if (auto *mdecl = dyn_cast<clang::CXXMethodDecl>(decl)) {
40594020 if (mdecl->isStatic ()) {
@@ -4160,12 +4121,10 @@ namespace {
41604121 }
41614122 func->setAccess (importer::convertClangAccess (decl->getAccess ()));
41624123
4163- if (!importFuncWithoutSignature) {
4164- bool success = processSpecialImportedFunc (
4165- func, importedName, decl->getOverloadedOperator ());
4166- if (!success)
4167- return nullptr ;
4168- }
4124+ bool success = processSpecialImportedFunc (
4125+ func, importedName, decl->getOverloadedOperator ());
4126+ if (!success)
4127+ return nullptr ;
41694128 }
41704129
41714130 result->setIsObjC (false );
@@ -4480,8 +4439,7 @@ namespace {
44804439 }
44814440
44824441 Decl *VisitFieldDecl (const clang::FieldDecl *decl) {
4483- if (!Impl.importSymbolicCXXDecls &&
4484- decl->hasAttr <clang::NoUniqueAddressAttr>()) {
4442+ if (decl->hasAttr <clang::NoUniqueAddressAttr>()) {
44854443 if (const auto *rd = decl->getType ()->getAsRecordDecl ()) {
44864444 // Clang can store the next field in the padding of this one. Swift
44874445 // does not support this yet so let's not import the field and
@@ -4743,11 +4701,6 @@ namespace {
47434701 if (name.empty ())
47444702 return nullptr ;
47454703
4746- if (Impl.importSymbolicCXXDecls )
4747- // Import an unspecialized C++ class template as a Swift value/class
4748- // type in symbolic mode.
4749- return Impl.importDecl (decl->getTemplatedDecl (), Impl.CurrentVersion );
4750-
47514704 auto loc = Impl.importSourceLoc (decl->getLocation ());
47524705 auto dc = Impl.importDeclContextOf (
47534706 decl, importedName.getEffectiveContext ());
0 commit comments