@@ -501,8 +501,8 @@ using ModuleDependenciesKindRefMap =
501501// / ensure that the returned cached dependency was one that can be found in the
502502// / current scanning action's filesystem view.
503503class GlobalModuleDependenciesCache {
504- // / Global cache contents specific to a target-triple specified on a scanner invocation
505- struct TargetSpecificGlobalCacheState {
504+ // / Global cache contents specific to a specific scanner invocation context
505+ struct ContextSpecificGlobalCacheState {
506506 // / All cached module dependencies, in the order in which they were
507507 // / encountered.
508508 std::vector<ModuleDependencyID> AllModules;
@@ -526,13 +526,13 @@ class GlobalModuleDependenciesCache {
526526
527527 // / A map from a String representing the target triple of a scanner invocation to the corresponding
528528 // / cached dependencies discovered so far when using this triple.
529- llvm::StringMap<std::unique_ptr<TargetSpecificGlobalCacheState >> TargetSpecificCacheMap ;
529+ llvm::StringMap<std::unique_ptr<ContextSpecificGlobalCacheState >> ContextSpecificCacheMap ;
530530
531- // / The current target triple cache configuration
532- Optional<std::string> CurrentTriple ;
531+ // / The current context hash configuration
532+ Optional<std::string> CurrentContextHash ;
533533
534- // / The triples used by scanners using this cache, in the order in which they were used
535- std::vector<std::string> AllTriples ;
534+ // / The context hashes used by scanners using this cache, in the order in which they were used
535+ std::vector<std::string> AllContextHashes ;
536536
537537 // / Retrieve the dependencies map that corresponds to the given dependency
538538 // / kind.
@@ -548,10 +548,10 @@ class GlobalModuleDependenciesCache {
548548 operator =(const GlobalModuleDependenciesCache &) = delete ;
549549 virtual ~GlobalModuleDependenciesCache () {}
550550
551- void configureForTriple (std::string triple );
551+ void configureForContextHash (std::string scanningContextHash );
552552
553- const std::vector<std::string>& getAllTriples () const {
554- return AllTriples ;
553+ const std::vector<std::string>& getAllContextHashes () const {
554+ return AllContextHashes ;
555555 }
556556
557557private:
@@ -570,11 +570,11 @@ class GlobalModuleDependenciesCache {
570570 Optional<ModuleDependencies>
571571 findDependencies (StringRef moduleName, ModuleLookupSpecifics details) const ;
572572
573- // / Return a pointer to the target -specific cache state of the current triple configuration .
574- TargetSpecificGlobalCacheState * getCurrentCache () const ;
573+ // / Return a pointer to the context -specific cache state of the current scanning action .
574+ ContextSpecificGlobalCacheState * getCurrentCache () const ;
575575
576- // / Return a pointer to the target-specific cache state of the specified triple configuration .
577- TargetSpecificGlobalCacheState* getCacheForTriple (StringRef triple ) const ;
576+ // / Return a pointer to the cache state of the specified context hash .
577+ ContextSpecificGlobalCacheState* getCacheForScanningContextHash (StringRef scanningContextHash ) const ;
578578
579579public:
580580 // / Look for module dependencies for a module with the given name.
@@ -600,9 +600,9 @@ class GlobalModuleDependenciesCache {
600600
601601 // / Reference the list of all module dependencies that are not source-based modules
602602 // / (i.e. interface dependencies, binary dependencies, clang dependencies).
603- const std::vector<ModuleDependencyID> &getAllNonSourceModules (StringRef triple ) const {
604- auto targetSpecificCache = getCacheForTriple (triple );
605- return targetSpecificCache ->AllModules ;
603+ const std::vector<ModuleDependencyID> &getAllNonSourceModules (StringRef scanningContextHash ) const {
604+ auto contextSpecificCache = getCacheForScanningContextHash (scanningContextHash );
605+ return contextSpecificCache ->AllModules ;
606606 }
607607
608608 // / Return the list of all source-based modules discovered by this cache
0 commit comments