@@ -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
@@ -3959,8 +3949,6 @@ namespace {
3959
3949
Impl.SwiftContext , SourceLoc (), templateParams, SourceLoc ());
3960
3950
}
3961
3951
3962
- bool importFuncWithoutSignature =
3963
- isa<clang::CXXMethodDecl>(decl) && Impl.importSymbolicCXXDecls ;
3964
3952
if (!dc->isModuleScopeContext () && !isClangNamespace (dc) &&
3965
3953
!isa<clang::CXXMethodDecl>(decl)) {
3966
3954
// Handle initializers.
@@ -4027,39 +4015,12 @@ namespace {
4027
4015
importedType =
4028
4016
Impl.importFunctionReturnType (dc, decl, allowNSUIntegerAsInt);
4029
4017
} 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);
4063
4024
4064
4025
if (auto *mdecl = dyn_cast<clang::CXXMethodDecl>(decl)) {
4065
4026
if (mdecl->isStatic ()) {
@@ -4166,12 +4127,10 @@ namespace {
4166
4127
}
4167
4128
func->setAccess (importer::convertClangAccess (decl->getAccess ()));
4168
4129
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 ;
4175
4134
}
4176
4135
4177
4136
result->setIsObjC (false );
@@ -4486,8 +4445,7 @@ namespace {
4486
4445
}
4487
4446
4488
4447
Decl *VisitFieldDecl (const clang::FieldDecl *decl) {
4489
- if (!Impl.importSymbolicCXXDecls &&
4490
- decl->hasAttr <clang::NoUniqueAddressAttr>()) {
4448
+ if (decl->hasAttr <clang::NoUniqueAddressAttr>()) {
4491
4449
if (const auto *rd = decl->getType ()->getAsRecordDecl ()) {
4492
4450
// Clang can store the next field in the padding of this one. Swift
4493
4451
// does not support this yet so let's not import the field and
@@ -4749,11 +4707,6 @@ namespace {
4749
4707
if (name.empty ())
4750
4708
return nullptr ;
4751
4709
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
-
4757
4710
auto loc = Impl.importSourceLoc (decl->getLocation ());
4758
4711
auto dc = Impl.importDeclContextOf (
4759
4712
decl, importedName.getEffectiveContext ());
0 commit comments