@@ -2141,8 +2141,7 @@ namespace {
2141
2141
}
2142
2142
2143
2143
// 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 ()) {
2146
2145
Impl.addImportDiagnostic (
2147
2146
decl, Diagnostic (
2148
2147
diag::record_is_dependent,
@@ -3068,11 +3067,8 @@ namespace {
3068
3067
auto semanticsKind = evaluateOrDefault (
3069
3068
Impl.SwiftContext .evaluator ,
3070
3069
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) {
3076
3072
3077
3073
HeaderLoc loc (decl->getLocation ());
3078
3074
if (hasUnsafeAPIAttr (decl))
@@ -3267,12 +3263,6 @@ namespace {
3267
3263
3268
3264
Decl *VisitClassTemplateSpecializationDecl (
3269
3265
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
-
3276
3266
bool isPair = decl->getSpecializedTemplate ()->isInStdNamespace () &&
3277
3267
decl->getSpecializedTemplate ()->getName () == " pair" ;
3278
3268
@@ -3953,8 +3943,6 @@ namespace {
3953
3943
Impl.SwiftContext , SourceLoc (), templateParams, SourceLoc ());
3954
3944
}
3955
3945
3956
- bool importFuncWithoutSignature =
3957
- isa<clang::CXXMethodDecl>(decl) && Impl.importSymbolicCXXDecls ;
3958
3946
if (!dc->isModuleScopeContext () && !isClangNamespace (dc) &&
3959
3947
!isa<clang::CXXMethodDecl>(decl)) {
3960
3948
// Handle initializers.
@@ -4021,39 +4009,12 @@ namespace {
4021
4009
importedType =
4022
4010
Impl.importFunctionReturnType (dc, decl, allowNSUIntegerAsInt);
4023
4011
} 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);
4057
4018
4058
4019
if (auto *mdecl = dyn_cast<clang::CXXMethodDecl>(decl)) {
4059
4020
if (mdecl->isStatic ()) {
@@ -4160,12 +4121,10 @@ namespace {
4160
4121
}
4161
4122
func->setAccess (importer::convertClangAccess (decl->getAccess ()));
4162
4123
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 ;
4169
4128
}
4170
4129
4171
4130
result->setIsObjC (false );
@@ -4480,8 +4439,7 @@ namespace {
4480
4439
}
4481
4440
4482
4441
Decl *VisitFieldDecl (const clang::FieldDecl *decl) {
4483
- if (!Impl.importSymbolicCXXDecls &&
4484
- decl->hasAttr <clang::NoUniqueAddressAttr>()) {
4442
+ if (decl->hasAttr <clang::NoUniqueAddressAttr>()) {
4485
4443
if (const auto *rd = decl->getType ()->getAsRecordDecl ()) {
4486
4444
// Clang can store the next field in the padding of this one. Swift
4487
4445
// does not support this yet so let's not import the field and
@@ -4743,11 +4701,6 @@ namespace {
4743
4701
if (name.empty ())
4744
4702
return nullptr ;
4745
4703
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
-
4751
4704
auto loc = Impl.importSourceLoc (decl->getLocation ());
4752
4705
auto dc = Impl.importDeclContextOf (
4753
4706
decl, importedName.getEffectiveContext ());
0 commit comments