aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangpchmanager/projectupdater.h
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-03-13 15:09:30 +0100
committerMarco Bubke <marco.bubke@qt.io>2019-04-01 10:31:38 +0000
commit6effa1822bd9bd265504c5ac3fed3fa5281e169f (patch)
tree794897a4f1f31c6040b64910ad807a865b0af451 /src/plugins/clangpchmanager/projectupdater.h
parent72494277490566a04cb03bfbc25936eaa996c3b1 (diff)
Clang: Improve project part updating
The project part ids are now already created very early in the database. This removes some checks because we can assume that an id already exists. The project part are now completely persistent, so we can read them from the database and compare them with new generated from a new creator session. This should help to not recreate the same PCH again and again. Task-number: QTCREATORBUG-21151 Change-Id: Iced818ff9f7431eaed3e37978087cc0a43b9afda Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/clangpchmanager/projectupdater.h')
-rw-r--r--src/plugins/clangpchmanager/projectupdater.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/clangpchmanager/projectupdater.h b/src/plugins/clangpchmanager/projectupdater.h
index 896a02def0..044b86f637 100644
--- a/src/plugins/clangpchmanager/projectupdater.h
+++ b/src/plugins/clangpchmanager/projectupdater.h
@@ -33,6 +33,7 @@
#include <generatedfiles.h>
#include <includesearchpath.h>
#include <projectpartcontainer.h>
+#include <projectpartsstorageinterface.h>
#include <projectexplorer/headerpath.h>
@@ -69,11 +70,16 @@ public:
};
ProjectUpdater(ClangBackEnd::ProjectManagementServerInterface &server,
- ClangBackEnd::FilePathCachingInterface &filePathCache);
+ ClangBackEnd::FilePathCachingInterface &filePathCache,
+ ClangBackEnd::ProjectPartsStorageInterface &projectPartsStorage)
+ : m_server(server)
+ , m_filePathCache(filePathCache)
+ , m_projectPartsStorage(projectPartsStorage)
+ {}
void updateProjectParts(const std::vector<CppTools::ProjectPart *> &projectParts,
Utils::SmallStringVector &&toolChainArguments);
- void removeProjectParts(const QStringList &projectPartIds);
+ void removeProjectParts(ClangBackEnd::ProjectPartIds projectPartIds);
void updateGeneratedFiles(ClangBackEnd::V2::FileContainers &&generatedFiles);
void removeGeneratedFiles(ClangBackEnd::FilePaths &&filePaths);
@@ -88,6 +94,7 @@ public:
CppTools::ProjectPart *projectPart) const;
ClangBackEnd::ProjectPartContainers toProjectPartContainers(
std::vector<CppTools::ProjectPart *> projectParts) const;
+
void addToHeaderAndSources(HeaderAndSources &headerAndSources,
const CppTools::ProjectFile &projectFile) const;
static QStringList toolChainArguments(CppTools::ProjectPart *projectPart);
@@ -98,11 +105,16 @@ public:
static ClangBackEnd::FilePaths createExcludedPaths(
const ClangBackEnd::V2::FileContainers &generatedFiles);
+ QString fetchProjectPartName(ClangBackEnd::ProjectPartId projectPartId) const;
+
+ ClangBackEnd::ProjectPartIds toProjectPartIds(const QStringList &projectPartNames) const;
+
private:
ClangBackEnd::GeneratedFiles m_generatedFiles;
ClangBackEnd::FilePaths m_excludedPaths;
ClangBackEnd::ProjectManagementServerInterface &m_server;
ClangBackEnd::FilePathCachingInterface &m_filePathCache;
+ ClangBackEnd::ProjectPartsStorageInterface &m_projectPartsStorage;
};
} // namespace ClangPchManager