@@ -3202,21 +3202,24 @@ class ModuleImplicitImportsRequest
32023202 bool isCached () const { return true ; }
32033203};
32043204
3205- // / Checks whether a file performs an implementation-only import.
3206- class HasImplementationOnlyImportsRequest
3207- : public SimpleRequest<HasImplementationOnlyImportsRequest,
3208- bool (SourceFile *), RequestFlags::Cached> {
3205+ // / Checks whether a file contains any import declarations with the given flag.
3206+ class HasImportsMatchingFlagRequest
3207+ : public SimpleRequest<HasImportsMatchingFlagRequest,
3208+ bool (SourceFile *, ImportFlags),
3209+ RequestFlags::SeparatelyCached> {
32093210public:
32103211 using SimpleRequest::SimpleRequest;
32113212
32123213private:
32133214 friend SimpleRequest;
32143215
3215- bool evaluate (Evaluator &evaluator, SourceFile *SF) const ;
3216+ bool evaluate (Evaluator &evaluator, SourceFile *SF, ImportFlags flag ) const ;
32163217
32173218public:
32183219 // Cached.
32193220 bool isCached () const { return true ; }
3221+ Optional<bool > getCachedResult () const ;
3222+ void cacheResult (bool value) const ;
32203223};
32213224
32223225// / Get the library level of a module.
@@ -3260,15 +3263,15 @@ class ResolveTypeRequest
32603263void simple_display (llvm::raw_ostream &out, const TypeResolution *resolution);
32613264SourceLoc extractNearestSourceLoc (const TypeRepr *repr);
32623265
3263- // / Checks to see if any of the imports in a module use ` @_implementationOnly`
3266+ // / Checks to see if any of the imports in a module use \c @_implementationOnly
32643267// / in one file and not in another.
32653268// /
32663269// / Like redeclaration checking, but for imports.
32673270// /
32683271// / This is a request purely to ensure that we don't need to perform the same
32693272// / checking for each file we resolve imports for.
32703273// / FIXME: Once import resolution operates at module-level, this checking can
3271- // / integrated into it.
3274+ // / be integrated into it.
32723275class CheckInconsistentImplementationOnlyImportsRequest
32733276 : public SimpleRequest<CheckInconsistentImplementationOnlyImportsRequest,
32743277 evaluator::SideEffect (ModuleDecl *),
@@ -3286,6 +3289,32 @@ class CheckInconsistentImplementationOnlyImportsRequest
32863289 bool isCached () const { return true ; }
32873290};
32883291
3292+ // / Checks to see if any of the imports in a module use \c @_weakLinked
3293+ // / in one file and not in another.
3294+ // /
3295+ // / Like redeclaration checking, but for imports.
3296+ // /
3297+ // / This is a request purely to ensure that we don't need to perform the same
3298+ // / checking for each file we resolve imports for.
3299+ // / FIXME: Once import resolution operates at module-level, this checking can
3300+ // / be integrated into it.
3301+ class CheckInconsistentWeakLinkedImportsRequest
3302+ : public SimpleRequest<CheckInconsistentWeakLinkedImportsRequest,
3303+ evaluator::SideEffect (ModuleDecl *),
3304+ RequestFlags::Cached> {
3305+ public:
3306+ using SimpleRequest::SimpleRequest;
3307+
3308+ private:
3309+ friend SimpleRequest;
3310+
3311+ evaluator::SideEffect evaluate (Evaluator &evaluator, ModuleDecl *mod) const ;
3312+
3313+ public:
3314+ // Cached.
3315+ bool isCached () const { return true ; }
3316+ };
3317+
32893318// / Retrieves the primary source files in the main module.
32903319// FIXME: This isn't really a type-checking request, if we ever split off a
32913320// zone for more basic AST requests, this should be moved there.
0 commit comments