summaryrefslogtreecommitdiff
path: root/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-06-20 18:34:02 +0200
committerMarco Bubke <marco.bubke@qt.io>2019-07-04 08:40:45 +0000
commitcc87615fcdcd9bf555f00461911a3d0a6272b678 (patch)
treeadc6dbc0fd56370e7d12a5f47f17fdddbb7b4f61 /src/tools/clangrefactoringbackend/source/symbolindexer.cpp
parentc4b80a2ec0973d18fd01e9660f36cdfc2421edee (diff)
downloadqt-creator-cc87615fcdcd9bf555f00461911a3d0a6272b678.tar.gz
Clang: Differentiate between user and non user includes for updating
We don't want to recreate a PCH if the include or source is not contained by a PCH. Change-Id: If52fc1aed92054b4165cdc634656147fbe8baa47 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/tools/clangrefactoringbackend/source/symbolindexer.cpp')
-rw-r--r--src/tools/clangrefactoringbackend/source/symbolindexer.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
index 4f3a6f172f..4d042b3fd3 100644
--- a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
+++ b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
@@ -98,7 +98,7 @@ void SymbolIndexer::updateProjectPart(ProjectPartContainer &&projectPart)
std::vector<SymbolIndexerTask> symbolIndexerTask;
symbolIndexerTask.reserve(projectPart.sourcePathIds.size());
for (FilePathId sourcePathId : projectPart.sourcePathIds) {
- SourceTimeStamps dependentTimeStamps = m_symbolStorage.fetchIncludedIndexingTimeStamps(
+ SourceTimeStamps dependentTimeStamps = m_buildDependencyStorage.fetchIncludedIndexingTimeStamps(
sourcePathId);
if (!m_modifiedTimeChecker.isUpToDate(dependentTimeStamps)) {
@@ -122,7 +122,8 @@ void SymbolIndexer::updateProjectPart(ProjectPartContainer &&projectPart)
auto store = [&] {
Sqlite::ImmediateTransaction transaction{m_transactionInterface};
- m_symbolStorage.insertOrUpdateIndexingTimeStamps(symbolsCollector.fileStatuses());
+ m_buildDependencyStorage.insertOrUpdateIndexingTimeStamps(
+ symbolsCollector.fileStatuses());
m_symbolStorage.addSymbolsAndSourceLocations(symbolsCollector.symbols(),
symbolsCollector.sourceLocations());
transaction.commit();
@@ -144,28 +145,17 @@ void SymbolIndexer::updateProjectPart(ProjectPartContainer &&projectPart)
}
}
- m_pathWatcher.updateIdPaths(
- {{projectPartId, m_buildDependencyStorage.fetchPchSources(projectPartId)}});
+ m_pathWatcher.updateIdPaths({{{projectPartId, SourceType::Source},
+ m_buildDependencyStorage.fetchPchSources(projectPartId)}});
m_symbolIndexerTaskQueue.addOrUpdateTasks(std::move(symbolIndexerTask));
m_symbolIndexerTaskQueue.processEntries();
}
-void SymbolIndexer::pathsWithIdsChanged(const ProjectPartIds &) {}
+void SymbolIndexer::pathsWithIdsChanged(const std::vector<IdPaths> &) {}
void SymbolIndexer::pathsChanged(const FilePathIds &filePathIds)
{
m_modifiedTimeChecker.pathsChanged(filePathIds);
-
- FilePathIds dependentSourcePathIds = m_symbolStorage.fetchDependentSourceIds(filePathIds);
-
- std::vector<SymbolIndexerTask> symbolIndexerTask;
- symbolIndexerTask.reserve(dependentSourcePathIds.size());
-
- for (FilePathId dependentSourcePathId : dependentSourcePathIds)
- updateChangedPath(dependentSourcePathId, symbolIndexerTask);
-
- m_symbolIndexerTaskQueue.addOrUpdateTasks(std::move(symbolIndexerTask));
- m_symbolIndexerTaskQueue.processEntries();
}
void SymbolIndexer::updateChangedPath(FilePathId filePathId,
@@ -182,7 +172,8 @@ void SymbolIndexer::updateChangedPath(FilePathId filePathId,
ProjectPartId projectPartId = optionalArtefact->projectPartId;
- SourceTimeStamps dependentTimeStamps = m_symbolStorage.fetchIncludedIndexingTimeStamps(filePathId);
+ SourceTimeStamps dependentTimeStamps = m_buildDependencyStorage.fetchIncludedIndexingTimeStamps(
+ filePathId);
auto indexing = [optionalArtefact = std::move(optionalArtefact),
filePathId,
@@ -207,7 +198,7 @@ void SymbolIndexer::updateChangedPath(FilePathId filePathId,
auto store = [&] {
Sqlite::ImmediateTransaction transaction{m_transactionInterface};
- m_symbolStorage.insertOrUpdateIndexingTimeStamps(symbolsCollector.fileStatuses());
+ m_buildDependencyStorage.insertOrUpdateIndexingTimeStamps(symbolsCollector.fileStatuses());
m_symbolStorage.addSymbolsAndSourceLocations(symbolsCollector.symbols(),
symbolsCollector.sourceLocations());
transaction.commit();