@@ -7823,32 +7823,6 @@ static bool hasAnyUnsafePointerParameters(FuncDecl *func) {
7823
7823
return false ;
7824
7824
}
7825
7825
7826
- // / Determine whether the given Objective-C method is likely to be an
7827
- // / asynchronous handler based on its name.
7828
- static bool isObjCMethodLikelyAsyncHandler (
7829
- const clang::ObjCMethodDecl *method) {
7830
- auto selector = method->getSelector ();
7831
-
7832
- for (unsigned argIdx : range (std::max (selector.getNumArgs (), 1u ))) {
7833
- auto selectorPiece = selector.getNameForSlot (argIdx);
7834
- // For the first selector piece, look for the word "did" anywhere.
7835
- if (argIdx == 0 ) {
7836
- for (auto word : camel_case::getWords (selectorPiece)) {
7837
- if (word == " did" || word == " Did" )
7838
- return true ;
7839
- }
7840
-
7841
- continue ;
7842
- }
7843
-
7844
- // Otherwise, check whether any subsequent selector piece starts with "did".
7845
- if (camel_case::getFirstWord (selectorPiece) == " did" )
7846
- return true ;
7847
- }
7848
-
7849
- return false ;
7850
- }
7851
-
7852
7826
Type ClangImporter::Implementation::getMainActorType () {
7853
7827
if (MainActorType)
7854
7828
return *MainActorType;
@@ -8203,24 +8177,6 @@ void ClangImporter::Implementation::importAttributes(
8203
8177
if (ClangDecl->hasAttr <clang::PureAttr>()) {
8204
8178
MappedDecl->getAttrs ().add (new (C) EffectsAttr (EffectsKind::ReadOnly));
8205
8179
}
8206
-
8207
- // Infer @asyncHandler on imported protocol methods that meet the semantic
8208
- // requirements.
8209
- if (SwiftContext.LangOpts .EnableExperimentalConcurrency ) {
8210
- if (auto func = dyn_cast<FuncDecl>(MappedDecl)) {
8211
- if (auto proto = dyn_cast<ProtocolDecl>(func->getDeclContext ())) {
8212
- if (proto->isObjC () && isa<clang::ObjCMethodDecl>(ClangDecl) &&
8213
- func->isInstanceMember () && !isa<AccessorDecl>(func) &&
8214
- isObjCMethodLikelyAsyncHandler (
8215
- cast<clang::ObjCMethodDecl>(ClangDecl)) &&
8216
- func->canBeAsyncHandler () &&
8217
- !hasAnyUnsafePointerParameters (func)) {
8218
- MappedDecl->getAttrs ().add (
8219
- new (C) AsyncHandlerAttr (/* IsImplicit=*/ false ));
8220
- }
8221
- }
8222
- }
8223
- }
8224
8180
}
8225
8181
8226
8182
Decl *
0 commit comments