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