Clang: Split symbol storage

We need UsedMacros and source related statements in the PCH manager too,
so we have to split that class.

Task-number: QTCREATORBUG-21289
Change-Id: Ie27d4b518b3d6d9174e93fcb243fdb55a09ddf51
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-10-11 18:09:55 +02:00
parent 468dcc67cb
commit 2c885fa3d4
17 changed files with 773 additions and 789 deletions

View File

@@ -58,12 +58,14 @@ private:
SymbolIndexer::SymbolIndexer(SymbolIndexerTaskQueueInterface &symbolIndexerTaskQueue,
SymbolStorageInterface &symbolStorage,
UsedMacroAndSourceStorageInterface &usedMacroAndSourceStorage,
ClangPathWatcherInterface &pathWatcher,
FilePathCachingInterface &filePathCache,
FileStatusCache &fileStatusCache,
Sqlite::TransactionInterface &transactionInterface)
: m_symbolIndexerTaskQueue(symbolIndexerTaskQueue),
m_symbolStorage(symbolStorage),
m_usedMacroAndSourceStorage(usedMacroAndSourceStorage),
m_pathWatcher(pathWatcher),
m_filePathCache(filePathCache),
m_fileStatusCache(fileStatusCache),
@@ -115,11 +117,11 @@ void SymbolIndexer::updateProjectPart(V2::ProjectPartContainer &&projectPart)
m_symbolStorage.updateProjectPartSources(projectPartId,
symbolsCollector.sourceFiles());
m_symbolStorage.insertOrUpdateUsedMacros(symbolsCollector.usedMacros());
m_usedMacroAndSourceStorage.insertOrUpdateUsedMacros(symbolsCollector.usedMacros());
m_symbolStorage.insertFileStatuses(symbolsCollector.fileStatuses());
m_usedMacroAndSourceStorage.insertFileStatuses(symbolsCollector.fileStatuses());
m_symbolStorage.insertOrUpdateSourceDependencies(symbolsCollector.sourceDependencies());
m_usedMacroAndSourceStorage.insertOrUpdateSourceDependencies(symbolsCollector.sourceDependencies());
transaction.commit();
};
@@ -180,11 +182,11 @@ void SymbolIndexer::updateChangedPath(FilePathId filePathId,
m_symbolStorage.updateProjectPartSources(projectPartId, symbolsCollector.sourceFiles());
m_symbolStorage.insertOrUpdateUsedMacros(symbolsCollector.usedMacros());
m_usedMacroAndSourceStorage.insertOrUpdateUsedMacros(symbolsCollector.usedMacros());
m_symbolStorage.insertFileStatuses(symbolsCollector.fileStatuses());
m_usedMacroAndSourceStorage.insertFileStatuses(symbolsCollector.fileStatuses());
m_symbolStorage.insertOrUpdateSourceDependencies(symbolsCollector.sourceDependencies());
m_usedMacroAndSourceStorage.insertOrUpdateSourceDependencies(symbolsCollector.sourceDependencies());
transaction.commit();
};
@@ -212,7 +214,7 @@ FilePathIds SymbolIndexer::filterChangedFiles(const V2::ProjectPartContainer &pr
ids.reserve(projectPart.sourcePathIds.size());
for (const FilePathId &sourceId : projectPart.sourcePathIds) {
long long oldLastModified = m_symbolStorage.fetchLowestLastModifiedTime(sourceId);
long long oldLastModified = m_usedMacroAndSourceStorage.fetchLowestLastModifiedTime(sourceId);
long long currentLastModified = m_fileStatusCache.lastModifiedTime(sourceId);
if (oldLastModified < currentLastModified)
ids.push_back(sourceId);