From cc87615fcdcd9bf555f00461911a3d0a6272b678 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 20 Jun 2019 18:34:02 +0200 Subject: 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 --- .../source/symbolindexer.cpp | 27 ++++++++-------------- 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'src/tools/clangrefactoringbackend/source/symbolindexer.cpp') 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.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 &) {} void SymbolIndexer::pathsChanged(const FilePathIds &filePathIds) { m_modifiedTimeChecker.pathsChanged(filePathIds); - - FilePathIds dependentSourcePathIds = m_symbolStorage.fetchDependentSourceIds(filePathIds); - - std::vector 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(); -- cgit v1.2.1