@@ -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
@@ -3959,8 +3949,6 @@ namespace {
39593949 Impl.SwiftContext , SourceLoc (), templateParams, SourceLoc ());
39603950 }
39613951
3962- bool importFuncWithoutSignature =
3963- isa<clang::CXXMethodDecl>(decl) && Impl.importSymbolicCXXDecls ;
39643952 if (!dc->isModuleScopeContext () && !isClangNamespace (dc) &&
39653953 !isa<clang::CXXMethodDecl>(decl)) {
39663954 // Handle initializers.
@@ -4027,39 +4015,12 @@ namespace {
40274015 importedType =
40284016 Impl.importFunctionReturnType (dc, decl, allowNSUIntegerAsInt);
40294017 } else {
4030- if (importFuncWithoutSignature) {
4031- importedType = ImportedType{Impl.SwiftContext .getVoidType (), false };
4032- if (decl->param_empty ())
4033- bodyParams = ParameterList::createEmpty (Impl.SwiftContext );
4034- else {
4035- llvm::SmallVector<ParamDecl *, 4 > params;
4036- for (const auto ¶m : decl->parameters ()) {
4037-
4038- Identifier bodyName =
4039- Impl.importFullName (param, Impl.CurrentVersion )
4040- .getBaseIdentifier (Impl.SwiftContext );
4041- auto paramInfo = Impl.createDeclWithClangNode <ParamDecl>(
4042- param, AccessLevel::Private, SourceLoc (), SourceLoc (),
4043- Identifier (), Impl.importSourceLoc (param->getLocation ()),
4044- bodyName, Impl.ImportedHeaderUnit );
4045- paramInfo->setSpecifier (ParamSpecifier::Default);
4046- paramInfo->setInterfaceType (Impl.SwiftContext .TheAnyType );
4047- if (param->hasDefaultArg ()) {
4048- paramInfo->setDefaultArgumentKind (DefaultArgumentKind::Normal);
4049- paramInfo->setDefaultValueStringRepresentation (" cxxDefaultArg" );
4050- }
4051- params.push_back (paramInfo);
4052- }
4053- bodyParams = ParameterList::create (Impl.SwiftContext , params);
4054- }
4055- } else {
4056- // Import the function type. If we have parameters, make sure their
4057- // names get into the resulting function type.
4058- importedType = Impl.importFunctionParamsAndReturnType (
4059- dc, decl, {decl->param_begin (), decl->param_size ()},
4060- decl->isVariadic (), isInSystemModule (dc), name, bodyParams,
4061- templateParams);
4062- }
4018+ // Import the function type. If we have parameters, make sure their
4019+ // names get into the resulting function type.
4020+ importedType = Impl.importFunctionParamsAndReturnType (
4021+ dc, decl, {decl->param_begin (), decl->param_size ()},
4022+ decl->isVariadic (), isInSystemModule (dc), name, bodyParams,
4023+ templateParams);
40634024
40644025 if (auto *mdecl = dyn_cast<clang::CXXMethodDecl>(decl)) {
40654026 if (mdecl->isStatic ()) {
@@ -4166,12 +4127,10 @@ namespace {
41664127 }
41674128 func->setAccess (importer::convertClangAccess (decl->getAccess ()));
41684129
4169- if (!importFuncWithoutSignature) {
4170- bool success = processSpecialImportedFunc (
4171- func, importedName, decl->getOverloadedOperator ());
4172- if (!success)
4173- return nullptr ;
4174- }
4130+ bool success = processSpecialImportedFunc (
4131+ func, importedName, decl->getOverloadedOperator ());
4132+ if (!success)
4133+ return nullptr ;
41754134 }
41764135
41774136 result->setIsObjC (false );
@@ -4486,8 +4445,7 @@ namespace {
44864445 }
44874446
44884447 Decl *VisitFieldDecl (const clang::FieldDecl *decl) {
4489- if (!Impl.importSymbolicCXXDecls &&
4490- decl->hasAttr <clang::NoUniqueAddressAttr>()) {
4448+ if (decl->hasAttr <clang::NoUniqueAddressAttr>()) {
44914449 if (const auto *rd = decl->getType ()->getAsRecordDecl ()) {
44924450 // Clang can store the next field in the padding of this one. Swift
44934451 // does not support this yet so let's not import the field and
@@ -4749,11 +4707,6 @@ namespace {
47494707 if (name.empty ())
47504708 return nullptr ;
47514709
4752- if (Impl.importSymbolicCXXDecls )
4753- // Import an unspecialized C++ class template as a Swift value/class
4754- // type in symbolic mode.
4755- return Impl.importDecl (decl->getTemplatedDecl (), Impl.CurrentVersion );
4756-
47574710 auto loc = Impl.importSourceLoc (decl->getLocation ());
47584711 auto dc = Impl.importDeclContextOf (
47594712 decl, importedName.getEffectiveContext ());
0 commit comments