aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-06-17 18:17:49 +0200
committerMarco Bubke <marco.bubke@qt.io>2019-06-27 12:32:02 +0000
commitcbfd9dc16b41176ce5a79bd9e11a336e853573a0 (patch)
tree583378ee37c5a7b8a191d2f725098081b44217eb /src
parentbbd58ca30b32f6015a5e7eb16884dfb9f6108f17 (diff)
Clang: Update ModifiedTimeChecker in SymbolIndexer
If a watched file changed we should update the ModifiedTimeChecker too. Change-Id: Ie43f5cf5b6dd4ddb1383168a1326add21f6e3e9d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/libs/clangsupport/modifiedtimechecker.h3
-rw-r--r--src/libs/clangsupport/modifiedtimecheckerinterface.h1
-rw-r--r--src/tools/clangrefactoringbackend/source/symbolindexer.cpp6
-rw-r--r--src/tools/clangrefactoringbackend/source/symbolindexer.h2
4 files changed, 8 insertions, 4 deletions
diff --git a/src/libs/clangsupport/modifiedtimechecker.h b/src/libs/clangsupport/modifiedtimechecker.h
index c9b62c4673..9247933b18 100644
--- a/src/libs/clangsupport/modifiedtimechecker.h
+++ b/src/libs/clangsupport/modifiedtimechecker.h
@@ -25,6 +25,7 @@
#pragma once
+#include "clangpathwatcher.h"
#include "filepathcachinginterface.h"
#include "modifiedtimecheckerinterface.h"
@@ -54,7 +55,7 @@ public:
return compareEntries(sourceEntries);
}
- void pathsChanged(const FilePathIds &filePathIds)
+ void pathsChanged(const FilePathIds &filePathIds) override
{
using SourceTimeStampReferences = std::vector<std::reference_wrapper<SourceTimeStamp>>;
diff --git a/src/libs/clangsupport/modifiedtimecheckerinterface.h b/src/libs/clangsupport/modifiedtimecheckerinterface.h
index a0e79b0701..b48c38869e 100644
--- a/src/libs/clangsupport/modifiedtimecheckerinterface.h
+++ b/src/libs/clangsupport/modifiedtimecheckerinterface.h
@@ -38,6 +38,7 @@ public:
ModifiedTimeCheckerInterface &operator=(const ModifiedTimeCheckerInterface &) = delete;
virtual bool isUpToDate(const SourceEntries &sourceEntries) const = 0;
+ virtual void pathsChanged(const FilePathIds &filePathIds) = 0;
protected:
~ModifiedTimeCheckerInterface() = default;
diff --git a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
index 1ee61eb67c..299088aa4b 100644
--- a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
+++ b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
@@ -87,8 +87,8 @@ SymbolIndexer::SymbolIndexer(SymbolIndexerTaskQueueInterface &symbolIndexerTaskQ
void SymbolIndexer::updateProjectParts(ProjectPartContainers &&projectParts)
{
- for (ProjectPartContainer &projectPart : projectParts)
- updateProjectPart(std::move(projectPart));
+ for (ProjectPartContainer &projectPart : projectParts)
+ updateProjectPart(std::move(projectPart));
}
void SymbolIndexer::updateProjectPart(ProjectPartContainer &&projectPart)
@@ -154,6 +154,8 @@ void SymbolIndexer::pathsWithIdsChanged(const ProjectPartIds &) {}
void SymbolIndexer::pathsChanged(const FilePathIds &filePathIds)
{
+ m_modifiedTimeChecker.pathsChanged(filePathIds);
+
FilePathIds dependentSourcePathIds = m_symbolStorage.fetchDependentSourceIds(filePathIds);
std::vector<SymbolIndexerTask> symbolIndexerTask;
diff --git a/src/tools/clangrefactoringbackend/source/symbolindexer.h b/src/tools/clangrefactoringbackend/source/symbolindexer.h
index 64b442bf33..d969cd8026 100644
--- a/src/tools/clangrefactoringbackend/source/symbolindexer.h
+++ b/src/tools/clangrefactoringbackend/source/symbolindexer.h
@@ -29,8 +29,8 @@
#include "symbolindexertaskqueueinterface.h"
#include "symbolstorageinterface.h"
#include "builddependenciesstorageinterface.h"
-#include "clangpathwatcher.h"
+#include <clangpathwatcher.h>
#include <filecontainerv2.h>
#include <modifiedtimecheckerinterface.h>
#include <precompiledheaderstorageinterface.h>