@@ -338,24 +338,15 @@ SILGenModule::getConformanceToBridgedStoredNSError(SILLocation loc, Type type) {
338
338
return SwiftModule->lookupConformance (type, proto);
339
339
}
340
340
341
- static FuncDecl *lookupConcurrencyIntrinsic (ASTContext &C,
342
- Optional<FuncDecl*> &cache,
343
- StringRef name) {
341
+ static FuncDecl *lookupIntrinsic (ModuleDecl &module ,
342
+ Optional<FuncDecl *> &cache, Identifier name) {
344
343
if (cache)
345
344
return *cache;
346
-
347
- auto *module = C.getLoadedModule (C.Id_Concurrency );
348
- if (!module ) {
349
- cache = nullptr ;
350
- return nullptr ;
351
- }
352
-
353
- SmallVector<ValueDecl *, 1 > decls;
354
- module ->lookupQualified (module ,
355
- DeclNameRef (C.getIdentifier (name)),
356
- NL_QualifiedDefault | NL_IncludeUsableFromInline,
357
- decls);
358
345
346
+ SmallVector<ValueDecl *, 1 > decls;
347
+ module .lookupQualified (&module , DeclNameRef (name),
348
+ NL_QualifiedDefault | NL_IncludeUsableFromInline,
349
+ decls);
359
350
if (decls.size () != 1 ) {
360
351
cache = nullptr ;
361
352
return nullptr ;
@@ -365,6 +356,18 @@ static FuncDecl *lookupConcurrencyIntrinsic(ASTContext &C,
365
356
return func;
366
357
}
367
358
359
+ static FuncDecl *lookupConcurrencyIntrinsic (ASTContext &C,
360
+ Optional<FuncDecl *> &cache,
361
+ StringRef name) {
362
+ auto *module = C.getLoadedModule (C.Id_Concurrency );
363
+ if (!module ) {
364
+ cache = nullptr ;
365
+ return nullptr ;
366
+ }
367
+
368
+ return lookupIntrinsic (*module , cache, C.getIdentifier (name));
369
+ }
370
+
368
371
FuncDecl *
369
372
SILGenModule::getAsyncLetStart () {
370
373
return lookupConcurrencyIntrinsic (getASTContext (),
0 commit comments