diff options
author | Marco Bubke <marco.bubke@qt.io> | 2019-08-06 13:12:03 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2019-08-27 11:51:28 +0000 |
commit | f9fb4508d4b73b59b7a7a3c74c009cdccb24d21c (patch) | |
tree | e4ebcfda4cd6a0021ff7730187310a460057db8e /src | |
parent | 912b4763e00437d32759ba948e9bc678ff53b6be (diff) | |
download | qt-creator-f9fb4508d4b73b59b7a7a3c74c009cdccb24d21c.tar.gz |
Clang: Optimize file path cache
We now fetch all directories and sources from the database at file
path cache creation.
Change-Id: I92510b49a234128f4c82b840611db82ead3f1a54
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/clangsupport/filepathcache.h | 81 | ||||
-rw-r--r-- | src/libs/clangsupport/filepathcaching.cpp | 25 | ||||
-rw-r--r-- | src/libs/clangsupport/filepathcaching.h | 23 | ||||
-rw-r--r-- | src/libs/clangsupport/filepathstorage.h | 2 | ||||
-rw-r--r-- | src/libs/clangsupport/filepathstoragesources.h | 97 | ||||
-rw-r--r-- | src/libs/clangsupport/filepathstoragesqlitestatementfactory.h | 14 | ||||
-rw-r--r-- | src/libs/clangsupport/stringcache.h | 79 | ||||
-rw-r--r-- | src/libs/clangsupport/stringcachefwd.h | 7 | ||||
-rw-r--r-- | src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp | 10 | ||||
-rw-r--r-- | src/tools/clangpchmanagerbackend/source/pchcreator.cpp | 2 | ||||
-rw-r--r-- | src/tools/clangpchmanagerbackend/source/pchcreator.h | 16 | ||||
-rw-r--r-- | src/tools/clangrefactoringbackend/source/symbolindexing.h | 14 | ||||
-rw-r--r-- | src/tools/clangrefactoringbackend/source/symbolscollector.cpp | 4 | ||||
-rw-r--r-- | src/tools/clangrefactoringbackend/source/symbolscollector.h | 4 |
14 files changed, 216 insertions, 162 deletions
diff --git a/src/libs/clangsupport/filepathcache.h b/src/libs/clangsupport/filepathcache.h index 4845416d22..1771f5b6c3 100644 --- a/src/libs/clangsupport/filepathcache.h +++ b/src/libs/clangsupport/filepathcache.h @@ -29,6 +29,7 @@ #include "filepath.h" #include "filepathexceptions.h" #include "filepathid.h" +#include "filepathstoragesources.h" #include "filepathview.h" #include "stringcache.h" @@ -39,84 +40,36 @@ namespace ClangBackEnd { template <typename FilePathStorage> class CLANGSUPPORT_GCCEXPORT FilePathCache { - class FileNameView - { - public: - friend bool operator==(const FileNameView &first, const FileNameView &second) - { - return first.directoryId == second.directoryId - && first.fileName == second.fileName; - } - - static - int compare(FileNameView first, FileNameView second) noexcept - { - int directoryDifference = first.directoryId - second.directoryId; - - if (directoryDifference) - return directoryDifference; - - return Utils::compare(first.fileName, second.fileName); - } - - public: - Utils::SmallStringView fileName; - int directoryId; - }; - - class FileNameEntry - { - public: - FileNameEntry(Utils::SmallStringView fileName, int directoryId) - : fileName(fileName), - directoryId(directoryId) - {} - - FileNameEntry(FileNameView view) - : fileName(view.fileName), - directoryId(view.directoryId) - {} - - friend bool operator==(const FileNameEntry &first, const FileNameEntry &second) - { - return first.directoryId == second.directoryId - && first.fileName == second.fileName; - } - - operator FileNameView() const - { - return {fileName, directoryId}; - } - - operator Utils::SmallString() && - { - return std::move(fileName); - } - - public: - Utils::SmallString fileName; - int directoryId; - }; - using DirectoryPathCache = StringCache<Utils::PathString, Utils::SmallStringView, int, SharedMutex, decltype(&Utils::reverseCompare), - Utils::reverseCompare>; + Utils::reverseCompare, + Sources::Directory>; using FileNameCache = StringCache<FileNameEntry, FileNameView, int, SharedMutex, decltype(&FileNameView::compare), - FileNameView::compare>; + FileNameView::compare, + Sources::Source>; + + FilePathCache(const FilePathCache &) = default; + FilePathCache &operator=(const FilePathCache &) = default; + public: FilePathCache(FilePathStorage &filePathStorage) : m_filePathStorage(filePathStorage) - {} + { + m_directoryPathCache.populate(filePathStorage.fetchAllDirectories()); + m_fileNameCache.populate(filePathStorage.fetchAllSources()); + } + + FilePathCache(FilePathCache &&) = default; + FilePathCache &operator=(FilePathCache &&) = default; - FilePathCache(const FilePathCache &) = delete; - FilePathCache &operator=(const FilePathCache &) = delete; + FilePathCache clone() { return *this; } FilePathId filePathId(FilePathView filePath) const { diff --git a/src/libs/clangsupport/filepathcaching.cpp b/src/libs/clangsupport/filepathcaching.cpp index 372ed86bd3..4464ea8201 100644 --- a/src/libs/clangsupport/filepathcaching.cpp +++ b/src/libs/clangsupport/filepathcaching.cpp @@ -52,4 +52,29 @@ DirectoryPathId FilePathCaching::directoryPathId(FilePathId filePathId) const return m_cache.directoryPathId(filePathId); } +FilePathId CopyableFilePathCaching::filePathId(FilePathView filePath) const +{ + return m_cache.filePathId(filePath); +} + +FilePath CopyableFilePathCaching::filePath(FilePathId filePathId) const +{ + return m_cache.filePath(filePathId); +} + +DirectoryPathId CopyableFilePathCaching::directoryPathId(Utils::SmallStringView directoryPath) const +{ + return m_cache.directoryPathId(directoryPath); +} + +Utils::PathString CopyableFilePathCaching::directoryPath(DirectoryPathId directoryPathId) const +{ + return m_cache.directoryPath(directoryPathId); +} + +DirectoryPathId CopyableFilePathCaching::directoryPathId(FilePathId filePathId) const +{ + return m_cache.directoryPathId(filePathId); +} + } // namespace ClangBackEnd diff --git a/src/libs/clangsupport/filepathcaching.h b/src/libs/clangsupport/filepathcaching.h index f69b940b15..1ca6522752 100644 --- a/src/libs/clangsupport/filepathcaching.h +++ b/src/libs/clangsupport/filepathcaching.h @@ -40,9 +40,11 @@ namespace ClangBackEnd { class CLANGSUPPORT_EXPORT FilePathCaching final : public FilePathCachingInterface { + friend class CopyableFilePathCaching; using Factory = FilePathStorageSqliteStatementFactory<Sqlite::Database>; using Storage = FilePathStorage<Factory>; using Cache = FilePathCache<Storage>; + public: FilePathCaching(Sqlite::Database &database) : m_factory(database) @@ -60,4 +62,25 @@ private: Cache m_cache{m_storage}; }; +class CLANGSUPPORT_EXPORT CopyableFilePathCaching final : public FilePathCachingInterface +{ + using Factory = FilePathStorageSqliteStatementFactory<Sqlite::Database>; + using Storage = FilePathStorage<Factory>; + using Cache = FilePathCache<Storage>; + +public: + CopyableFilePathCaching(FilePathCaching &cache) + : m_cache(cache.m_cache.clone()) + {} + + FilePathId filePathId(FilePathView filePath) const override; + FilePath filePath(FilePathId filePathId) const override; + DirectoryPathId directoryPathId(Utils::SmallStringView directoryPath) const override; + Utils::PathString directoryPath(DirectoryPathId directoryPathId) const override; + DirectoryPathId directoryPathId(FilePathId filePathId) const override; + +private: + Cache m_cache; +}; + } // namespace ClangBackEnd diff --git a/src/libs/clangsupport/filepathstorage.h b/src/libs/clangsupport/filepathstorage.h index 8aba2ef6d2..8434f50659 100644 --- a/src/libs/clangsupport/filepathstorage.h +++ b/src/libs/clangsupport/filepathstorage.h @@ -212,7 +212,7 @@ public: ReadStatement &statement = m_statementFactory.selectAllSources; - auto sources = statement.template values<Sources::Source, 2>(8192); + auto sources = statement.template values<Sources::Source, 3>(8192); transaction.commit(); diff --git a/src/libs/clangsupport/filepathstoragesources.h b/src/libs/clangsupport/filepathstoragesources.h index e76cb3b2cf..d81c23f99b 100644 --- a/src/libs/clangsupport/filepathstoragesources.h +++ b/src/libs/clangsupport/filepathstoragesources.h @@ -33,41 +33,106 @@ #include <unordered_map> namespace ClangBackEnd { -namespace Sources { -class Directory + +template<typename StringType, typename StringViewType, typename IndexType> +class StringCacheEntry { public: - Directory(int directoryId, Utils::PathString &&directoryPath) - : directoryId(directoryId), directoryPath(std::move(directoryPath)) + StringCacheEntry(StringViewType string, IndexType id) + : string(string) + , id(id) {} - friend - bool operator==(const Directory &first, const Directory &second) + operator StringViewType() const { return string; } + +public: + StringType string; + IndexType id; +}; + +class FileNameView +{ +public: + friend bool operator==(const FileNameView &first, const FileNameView &second) + { + return first.directoryId == second.directoryId && first.fileName == second.fileName; + } + + static int compare(FileNameView first, FileNameView second) noexcept { - return first.directoryId == second.directoryId && first.directoryPath == second.directoryPath; + int directoryDifference = first.directoryId - second.directoryId; + + if (directoryDifference) + return directoryDifference; + + return Utils::compare(first.fileName, second.fileName); } public: + Utils::SmallStringView fileName; int directoryId; - Utils::PathString directoryPath; }; -class Source +class FileNameEntry { public: - Source(int sourceId, Utils::PathString &&sourceName) - : sourceId(sourceId), sourceName(std::move(sourceName)) + FileNameEntry(Utils::SmallStringView fileName, int directoryId) + : fileName(fileName) + , directoryId(directoryId) + {} + + FileNameEntry(FileNameView view) + : fileName(view.fileName) + , directoryId(view.directoryId) {} - friend - bool operator==(const Source &first, const Source &second) + friend bool operator==(const FileNameEntry &first, const FileNameEntry &second) { - return first.sourceId == second.sourceId && first.sourceName == second.sourceName; + return first.directoryId == second.directoryId && first.fileName == second.fileName; } + friend bool operator!=(const FileNameEntry &first, const FileNameEntry &second) + { + return !(first == second); + } + + operator FileNameView() const { return {fileName, directoryId}; } + + operator Utils::SmallString() && { return std::move(fileName); } + public: - int sourceId; - Utils::PathString sourceName; + Utils::SmallString fileName; + int directoryId; +}; + +namespace Sources { +class Directory : public StringCacheEntry<Utils::PathString, Utils::SmallStringView, int> +{ + using Base = StringCacheEntry<Utils::PathString, Utils::SmallStringView, int>; + +public: + using Base::Base; + + friend bool operator==(const Directory &first, const Directory &second) + { + return first.id == second.id && first.string == second.string; + } +}; + +class Source : public StringCacheEntry<FileNameEntry, FileNameView, int> +{ + using Base = StringCacheEntry<FileNameEntry, FileNameView, int>; + +public: + using Base::Base; + Source(Utils::SmallStringView sourceName, int directoryId, int sourceId) + : Base{{sourceName, directoryId}, sourceId} + {} + + friend bool operator==(const Source &first, const Source &second) + { + return first.id == second.id && first.string == second.string; + } }; class SourceNameAndDirectoryId diff --git a/src/libs/clangsupport/filepathstoragesqlitestatementfactory.h b/src/libs/clangsupport/filepathstoragesqlitestatementfactory.h index 27296a1df6..f0d261dd49 100644 --- a/src/libs/clangsupport/filepathstoragesqlitestatementfactory.h +++ b/src/libs/clangsupport/filepathstoragesqlitestatementfactory.h @@ -50,13 +50,8 @@ public: database }; ReadStatement selectDirectoryPathFromDirectoriesByDirectoryId{ - "SELECT directoryPath FROM directories WHERE directoryId = ?", - database - }; - ReadStatement selectAllDirectories{ - "SELECT directoryId, directoryPath FROM directories", - database - }; + "SELECT directoryPath FROM directories WHERE directoryId = ?", database}; + ReadStatement selectAllDirectories{"SELECT directoryPath, directoryId FROM directories", database}; WriteStatement insertIntoDirectories{ "INSERT INTO directories(directoryPath) VALUES (?)", database @@ -75,10 +70,7 @@ public: "INSERT INTO sources(directoryId, sourceName) VALUES (?,?)", database }; - ReadStatement selectAllSources{ - "SELECT sourceId, sourceName FROM sources", - database - }; + ReadStatement selectAllSources{"SELECT sourceName, directoryId, sourceId FROM sources", database}; }; } // namespace ClangBackEnd diff --git a/src/libs/clangsupport/stringcache.h b/src/libs/clangsupport/stringcache.h index 9192b46aa5..5d416a46c4 100644 --- a/src/libs/clangsupport/stringcache.h +++ b/src/libs/clangsupport/stringcache.h @@ -25,9 +25,11 @@ #pragma once +#include "filepathstoragesources.h" #include "stringcachealgorithms.h" #include "stringcachefwd.h" +#include <utils/algorithm.h> #include <utils/optional.h> #include <utils/smallstringfwd.h> @@ -90,42 +92,17 @@ private: QReadWriteLock m_mutex; }; -template <typename StringType, - typename StringViewType, - typename IndexType> -class StringCacheEntry -{ -public: - StringCacheEntry(StringType &&string, IndexType id) - : string(std::move(string)), - id(id) - {} - - operator StringViewType() const - { - return string; - } - - StringType string; - IndexType id; -}; - -template <typename StringType, - typename StringViewType, - typename IndexType> -using StringCacheEntries = std::vector<StringCacheEntry<StringType, StringViewType, IndexType>>; - -template <typename StringType, - typename StringViewType, - typename IndexType, - typename Mutex, - typename Compare, - Compare compare = Utils::compare> +template<typename StringType, + typename StringViewType, + typename IndexType, + typename Mutex, + typename Compare, + Compare compare = Utils::compare, + typename CacheEntry = StringCacheEntry<StringType, StringViewType, IndexType>> class StringCache { public: - using CacheEntry = StringCacheEntry<StringType, StringViewType, IndexType>; - using CacheEntries = StringCacheEntries<StringType, StringViewType, IndexType>; + using CacheEntries = std::vector<CacheEntry>; using const_iterator = typename CacheEntries::const_iterator; using Found = ClangBackEnd::Found<const_iterator>; @@ -135,8 +112,19 @@ public: m_indices.reserve(reserveSize); } - StringCache(const StringCache &) = delete; - StringCache &operator=(const StringCache &) = delete; + StringCache(const StringCache &other) + : m_strings(other.m_strings) + , m_indices(other.m_indices) + {} + StringCache &operator=(const StringCache &other) + { + if (*this != other) { + m_strings = other.m_strings; + m_indices = other.m_indices; + } + + return *this; + } void populate(CacheEntries &&entries) { @@ -154,14 +142,25 @@ public: }); m_strings = std::move(entries); - m_indices.resize(m_strings.size()); + + int max_id = 0; + + auto found = std::max_element(m_strings.begin(), + m_strings.end(), + [](const auto &first, const auto &second) { + return first.id < second.id; + }); + + if (found != m_strings.end()) + max_id = found->id + 1; + + m_indices.resize(max_id, -1); auto begin = m_strings.cbegin(); for (auto current = begin; current != m_strings.end(); ++current) - m_indices.at(current->id) = std::distance(begin, current); + m_indices[current->id] = std::distance(begin, current); } - IndexType stringId(StringViewType stringView) { std::shared_lock<Mutex> sharedLock(m_mutex); @@ -176,7 +175,7 @@ public: found = find(stringView); if (!found.wasFound) { IndexType index = insertString(found.iterator, stringView, IndexType(m_indices.size())); - found.iterator = m_strings.begin() + index;; + found.iterator = m_strings.begin() + index; } return found.iterator->id; @@ -300,7 +299,7 @@ private: StringViewType stringView, IndexType id) { - auto inserted = m_strings.emplace(beforeIterator, StringType(stringView), id); + auto inserted = m_strings.emplace(beforeIterator, stringView, id); auto newIndex = IndexType(std::distance(m_strings.begin(), inserted)); diff --git a/src/libs/clangsupport/stringcachefwd.h b/src/libs/clangsupport/stringcachefwd.h index adc00ff1f5..2059b503b6 100644 --- a/src/libs/clangsupport/stringcachefwd.h +++ b/src/libs/clangsupport/stringcachefwd.h @@ -31,12 +31,7 @@ namespace ClangBackEnd { class NonLockingMutex; -template <typename StringType, - typename StringViewType, - typename IndexType, - typename Mutex, - typename Compare, - Compare compare> +template<typename StringType, typename StringViewType, typename IndexType, typename Mutex, typename Compare, Compare compare, typename CacheEntry> class StringCache; } // namespace ClangBackEnd diff --git a/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp b/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp index f98e87eaf0..1dd3f9acbe 100644 --- a/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp +++ b/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp @@ -139,13 +139,13 @@ public: using Processor = ClangBackEnd::PchCreator; PchCreatorManager(const ClangBackEnd::GeneratedFiles &generatedFiles, ClangBackEnd::Environment &environment, - Sqlite::Database &database, + ClangBackEnd::FilePathCaching &filePathCache, PchManagerServer &pchManagerServer, ClangBackEnd::ClangPathWatcherInterface &pathWatcher, ClangBackEnd::BuildDependenciesStorageInterface &buildDependenciesStorage) : ProcessorManager(generatedFiles) , m_environment(environment) - , m_database(database) + , m_filePathCache(filePathCache) , m_pchManagerServer(pchManagerServer) , m_pathWatcher(pathWatcher) , m_buildDependenciesStorage(buildDependenciesStorage) @@ -155,7 +155,7 @@ protected: std::unique_ptr<ClangBackEnd::PchCreator> createProcessor() const override { return std::make_unique<PchCreator>(m_environment, - m_database, + m_filePathCache, *m_pchManagerServer.client(), m_pathWatcher, m_buildDependenciesStorage); @@ -163,7 +163,7 @@ protected: private: ClangBackEnd::Environment &m_environment; - Sqlite::Database &m_database; + ClangBackEnd::FilePathCaching &m_filePathCache; ClangBackEnd::PchManagerServer &m_pchManagerServer; ClangBackEnd::ClangPathWatcherInterface &m_pathWatcher; ClangBackEnd::BuildDependenciesStorageInterface &m_buildDependenciesStorage; @@ -194,7 +194,7 @@ struct Data // because we have a cycle dependency generatedFiles}; PchCreatorManager pchCreatorManager{generatedFiles, environment, - database, + filePathCache, clangPchManagerServer, includeWatcher, buildDependencyStorage}; diff --git a/src/tools/clangpchmanagerbackend/source/pchcreator.cpp b/src/tools/clangpchmanagerbackend/source/pchcreator.cpp index 9d0f338b87..f9e94fc14f 100644 --- a/src/tools/clangpchmanagerbackend/source/pchcreator.cpp +++ b/src/tools/clangpchmanagerbackend/source/pchcreator.cpp @@ -211,7 +211,7 @@ void PchCreator::doInMainThreadAfterFinished() } } -const FilePathCaching &PchCreator::filePathCache() +const FilePathCachingInterface &PchCreator::filePathCache() { return m_filePathCache; } diff --git a/src/tools/clangpchmanagerbackend/source/pchcreator.h b/src/tools/clangpchmanagerbackend/source/pchcreator.h index bc217d59e7..af8bf8bfdd 100644 --- a/src/tools/clangpchmanagerbackend/source/pchcreator.h +++ b/src/tools/clangpchmanagerbackend/source/pchcreator.h @@ -54,14 +54,16 @@ class PchCreator final : public PchCreatorInterface { public: PchCreator(Environment &environment, - Sqlite::Database &database, + FilePathCaching &filePathCache, PchManagerClientInterface &pchManagerClient, ClangPathWatcherInterface &clangPathwatcher, BuildDependenciesStorageInterface &buildDependenciesStorage) - : m_filePathCache(database), m_environment(environment), - m_pchManagerClient(pchManagerClient), - m_clangPathwatcher(clangPathwatcher), - m_buildDependenciesStorage(buildDependenciesStorage) {} + : m_filePathCache(filePathCache) + , m_environment(environment) + , m_pchManagerClient(pchManagerClient) + , m_clangPathwatcher(clangPathwatcher) + , m_buildDependenciesStorage(buildDependenciesStorage) + {} void generatePch(PchTask &&pchTask) override; const ProjectPartPch &projectPartPch() override; @@ -71,7 +73,7 @@ public: void clear() override; void doInMainThreadAfterFinished() override; - const FilePathCaching &filePathCache(); + const FilePathCachingInterface &filePathCache(); Utils::SmallString generatePchIncludeFileContent(const FilePathIds &includeIds) const; bool generatePch(NativeFilePathView path, Utils::SmallStringView content); @@ -93,7 +95,7 @@ private: mutable std::mt19937_64 randomNumberGenator{std::random_device{}()}; ClangTool m_clangTool; ProjectPartPch m_projectPartPch; - FilePathCaching m_filePathCache; + CopyableFilePathCaching m_filePathCache; FilePathIds m_watchedSystemIncludes; FilePathIds m_watchedProjectIncludes; FilePathIds m_watchedUserIncludes; diff --git a/src/tools/clangrefactoringbackend/source/symbolindexing.h b/src/tools/clangrefactoringbackend/source/symbolindexing.h index 936a34af00..e680a45be0 100644 --- a/src/tools/clangrefactoringbackend/source/symbolindexing.h +++ b/src/tools/clangrefactoringbackend/source/symbolindexing.h @@ -63,19 +63,19 @@ class SymbolsCollectorManager final : public ClangBackEnd::ProcessorManager<Symb public: using Processor = SymbolsCollector; SymbolsCollectorManager(const ClangBackEnd::GeneratedFiles &generatedFiles, - Sqlite::Database &database) - : ProcessorManager(generatedFiles), - m_database(database) + FilePathCaching &filePathCache) + : ProcessorManager(generatedFiles) + , m_filePathCache(filePathCache) {} protected: std::unique_ptr<SymbolsCollector> createProcessor() const { - return std::make_unique<SymbolsCollector>(m_database); + return std::make_unique<SymbolsCollector>(m_filePathCache); } private: - Sqlite::Database &m_database; + FilePathCaching &m_filePathCache; }; class SymbolIndexing final : public SymbolIndexingInterface @@ -84,7 +84,7 @@ public: using BuildDependenciesStorage = ClangBackEnd::BuildDependenciesStorage<Sqlite::Database>; using SymbolStorage = ClangBackEnd::SymbolStorage<Sqlite::Database>; SymbolIndexing(Sqlite::Database &database, - FilePathCachingInterface &filePathCache, + FilePathCaching &filePathCache, const GeneratedFiles &generatedFiles, ProgressCounter::SetProgressCallback &&setProgressCallback, const Environment &environment) @@ -93,7 +93,7 @@ public: , m_precompiledHeaderStorage(database) , m_projectPartsStorage(database) , m_symbolStorage(database) - , m_collectorManger(generatedFiles, database) + , m_collectorManger(generatedFiles, filePathCache) , m_progressCounter(std::move(setProgressCallback)) , m_indexer(m_indexerQueue, m_symbolStorage, diff --git a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp index ac93ae360d..a233f6d8fe 100644 --- a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp +++ b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp @@ -31,8 +31,8 @@ namespace ClangBackEnd { -SymbolsCollector::SymbolsCollector(Sqlite::Database &database) - : m_filePathCache(database) +SymbolsCollector::SymbolsCollector(FilePathCaching &filePathCache) + : m_filePathCache(filePathCache) , m_indexDataConsumer(std::make_shared<IndexDataConsumer>(m_symbolEntries, m_sourceLocationEntries, m_filePathCache, diff --git a/src/tools/clangrefactoringbackend/source/symbolscollector.h b/src/tools/clangrefactoringbackend/source/symbolscollector.h index 1ad0c9e29c..824fe057fd 100644 --- a/src/tools/clangrefactoringbackend/source/symbolscollector.h +++ b/src/tools/clangrefactoringbackend/source/symbolscollector.h @@ -42,7 +42,7 @@ namespace ClangBackEnd { class SymbolsCollector final : public SymbolsCollectorInterface { public: - SymbolsCollector(Sqlite::Database &database); + SymbolsCollector(FilePathCaching &filePathCache); void addFiles(const FilePathIds &filePathIds, const Utils::SmallStringVector &arguments); @@ -65,7 +65,7 @@ public: bool isClean() const { return m_clangTool.isClean(); } private: - FilePathCaching m_filePathCache; + CopyableFilePathCaching m_filePathCache; ClangTool m_clangTool; SymbolEntries m_symbolEntries; SourceLocationEntries m_sourceLocationEntries; |