summaryrefslogtreecommitdiff
path: root/src/libs/clangsupport/projectpartsstorageinterface.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/libs/clangsupport/projectpartsstorageinterface.h
parent72494277490566a04cb03bfbc25936eaa996c3b1 (diff)
downloadqt-creator-6effa1822bd9bd265504c5ac3fed3fa5281e169f.tar.gz
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/libs/clangsupport/projectpartsstorageinterface.h')
-rw-r--r--src/libs/clangsupport/projectpartsstorageinterface.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/libs/clangsupport/projectpartsstorageinterface.h b/src/libs/clangsupport/projectpartsstorageinterface.h
new file mode 100644
index 0000000000..1127f70b1f
--- /dev/null
+++ b/src/libs/clangsupport/projectpartsstorageinterface.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#pragma once
+
+#include <projectpartcontainer.h>
+
+#include <sqlitetransaction.h>
+#include <utils/optional.h>
+#include <utils/smallstringview.h>
+
+#include <QJsonArray>
+#include <QJsonDocument>
+#include <QJsonObject>
+
+namespace ClangBackEnd {
+
+class ProjectPartsStorageInterface
+{
+public:
+ ProjectPartsStorageInterface() = default;
+ ProjectPartsStorageInterface(const ProjectPartsStorageInterface &) = delete;
+ ProjectPartsStorageInterface &operator=(const ProjectPartsStorageInterface &) = delete;
+
+ virtual ProjectPartContainers fetchProjectParts() const = 0;
+ virtual ProjectPartContainers fetchProjectParts(const ProjectPartIds &projectPartIds) const = 0;
+ virtual ProjectPartId fetchProjectPartId(Utils::SmallStringView projectPartName) const = 0;
+ virtual Utils::PathString fetchProjectPartName(ProjectPartId projectPartId) const = 0;
+ virtual void updateProjectPart(ProjectPartId projectPartId,
+ const Utils::SmallStringVector &commandLineArguments,
+ const CompilerMacros &compilerMacros,
+ const ClangBackEnd::IncludeSearchPaths &systemIncludeSearchPaths,
+ const ClangBackEnd::IncludeSearchPaths &projectIncludeSearchPaths,
+ Utils::Language language,
+ Utils::LanguageVersion languageVersion,
+ Utils::LanguageExtension languageExtension)
+ = 0;
+
+ virtual void updateProjectParts(const ProjectPartContainers &projectParts) = 0;
+
+ virtual Utils::optional<ProjectPartArtefact> fetchProjectPartArtefact(FilePathId sourceId) const = 0;
+ virtual Utils::optional<ProjectPartArtefact> fetchProjectPartArtefact(
+ ProjectPartId projectPartId) const = 0;
+
+ virtual Sqlite::TransactionInterface &transactionBackend() = 0;
+
+protected:
+ ~ProjectPartsStorageInterface() = default;
+};
+
+} // namespace ClangBackEnd