@@ -515,18 +515,6 @@ class GlobalModuleDependenciesCache {
515
515
// / The triples used by scanners using this cache, in the order in which they were used
516
516
std::vector<std::string> AllTriples;
517
517
518
- // / Additional information needed for Clang dependency scanning.
519
- ClangModuleDependenciesCacheImpl *clangImpl = nullptr ;
520
-
521
- // / Function that will delete \c clangImpl properly.
522
- void (*clangImplDeleter)(ClangModuleDependenciesCacheImpl *) = nullptr ;
523
-
524
- // / Free up the storage associated with the Clang implementation.
525
- void destroyClangImpl () {
526
- if (this ->clangImplDeleter )
527
- this ->clangImplDeleter (this ->clangImpl );
528
- }
529
-
530
518
// / Retrieve the dependencies map that corresponds to the given dependency
531
519
// / kind.
532
520
llvm::StringMap<ModuleDependenciesVector> &
@@ -540,7 +528,7 @@ class GlobalModuleDependenciesCache {
540
528
GlobalModuleDependenciesCache &
541
529
operator =(const GlobalModuleDependenciesCache &) = delete ;
542
530
543
- virtual ~GlobalModuleDependenciesCache () { destroyClangImpl (); }
531
+ virtual ~GlobalModuleDependenciesCache () {}
544
532
545
533
void configureForTriple (std::string triple);
546
534
@@ -553,19 +541,6 @@ class GlobalModuleDependenciesCache {
553
541
// / wrapped in an instance of `ModuleDependenciesCache`.
554
542
friend class ModuleDependenciesCache ;
555
543
556
- // / Set the Clang-specific implementation data.
557
- virtual void
558
- setClangImpl (ClangModuleDependenciesCacheImpl *clangImpl,
559
- void (*clangImplDeleter)(ClangModuleDependenciesCacheImpl *)) {
560
- destroyClangImpl ();
561
-
562
- this ->clangImpl = clangImpl;
563
- this ->clangImplDeleter = clangImplDeleter;
564
- }
565
-
566
- // / Retrieve the Clang-specific implementation data;
567
- ClangModuleDependenciesCacheImpl *getClangImpl () const { return clangImpl; }
568
-
569
544
// / Whether we have cached dependency information for the given module.
570
545
bool hasDependencies (StringRef moduleName,
571
546
ModuleLookupSpecifics details) const ;
@@ -632,6 +607,18 @@ class ModuleDependenciesCache {
632
607
// / the current scanning action.
633
608
ModuleDependenciesKindRefMap ModuleDependenciesMap;
634
609
610
+ // / Additional information needed for Clang dependency scanning.
611
+ ClangModuleDependenciesCacheImpl *clangImpl = nullptr ;
612
+
613
+ // / Function that will delete \c clangImpl properly.
614
+ void (*clangImplDeleter)(ClangModuleDependenciesCacheImpl *) = nullptr ;
615
+
616
+ // / Free up the storage associated with the Clang implementation.
617
+ void destroyClangImpl () {
618
+ if (this ->clangImplDeleter )
619
+ this ->clangImplDeleter (this ->clangImpl );
620
+ }
621
+
635
622
// / Retrieve the dependencies map that corresponds to the given dependency
636
623
// / kind.
637
624
llvm::StringMap<const ModuleDependencies *> &
@@ -654,19 +641,22 @@ class ModuleDependenciesCache {
654
641
ModuleDependenciesCache (GlobalModuleDependenciesCache &globalCache);
655
642
ModuleDependenciesCache (const ModuleDependenciesCache &) = delete ;
656
643
ModuleDependenciesCache &operator =(const ModuleDependenciesCache &) = delete ;
657
- virtual ~ModuleDependenciesCache () {}
644
+ virtual ~ModuleDependenciesCache () { destroyClangImpl (); }
658
645
659
646
public:
660
647
// / Set the Clang-specific implementation data.
661
648
void
662
649
setClangImpl (ClangModuleDependenciesCacheImpl *clangImpl,
663
650
void (*clangImplDeleter)(ClangModuleDependenciesCacheImpl *)) {
664
- globalCache.setClangImpl (clangImpl, clangImplDeleter);
651
+ destroyClangImpl ();
652
+
653
+ this ->clangImpl = clangImpl;
654
+ this ->clangImplDeleter = clangImplDeleter;
665
655
}
666
656
667
657
// / Retrieve the Clang-specific implementation data;
668
658
ClangModuleDependenciesCacheImpl *getClangImpl () const {
669
- return globalCache. getClangImpl () ;
659
+ return clangImpl ;
670
660
}
671
661
672
662
// / Whether we have cached dependency information for the given module.
0 commit comments