diff options
author | Marco Bubke <marco.bubke@qt.io> | 2019-05-22 12:26:58 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2019-06-17 10:46:21 +0000 |
commit | b213dee0134722fcdcae88efb514e0430fc72959 (patch) | |
tree | 51b62b0de0c934f30fd49a3a0056e44614f11209 /src/libs | |
parent | 912cb9278f7528709f9edf08060d997c20d3ec8c (diff) | |
download | qt-creator-b213dee0134722fcdcae88efb514e0430fc72959.tar.gz |
Clang: Improve updating
If project parts are up to date we send them directly to the indexer, so
the indexer can decide we something needs an update.
Change-Id: I7d4f32794c6b3a861cdefb3653a6dfd4e711f619
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/clangsupport/clangsupport-lib.pri | 1 | ||||
-rw-r--r-- | src/libs/clangsupport/precompiledheadersupdatedmessage.h | 31 | ||||
-rw-r--r-- | src/libs/clangsupport/projectpartid.h | 2 | ||||
-rw-r--r-- | src/libs/clangsupport/projectpartpch.cpp | 3 | ||||
-rw-r--r-- | src/libs/clangsupport/projectpartpch.h | 3 | ||||
-rw-r--r-- | src/libs/clangsupport/projectpartpchproviderinterface.h | 50 |
6 files changed, 17 insertions, 73 deletions
diff --git a/src/libs/clangsupport/clangsupport-lib.pri b/src/libs/clangsupport/clangsupport-lib.pri index 201c5bf538..df537f5848 100644 --- a/src/libs/clangsupport/clangsupport-lib.pri +++ b/src/libs/clangsupport/clangsupport-lib.pri @@ -204,7 +204,6 @@ HEADERS += \ $$PWD/nativefilepath.h \ $$PWD/filepathview.h \ $$PWD/compilermacro.h \ - $$PWD/projectpartpchproviderinterface.h \ $$PWD/updategeneratedfilesmessage.h \ $$PWD/removegeneratedfilesmessage.h \ $$PWD/generatedfiles.h \ diff --git a/src/libs/clangsupport/precompiledheadersupdatedmessage.h b/src/libs/clangsupport/precompiledheadersupdatedmessage.h index 9c17a3c9da..5bd24dcd49 100644 --- a/src/libs/clangsupport/precompiledheadersupdatedmessage.h +++ b/src/libs/clangsupport/precompiledheadersupdatedmessage.h @@ -25,7 +25,10 @@ #pragma once -#include "projectpartpch.h" +#include "clangsupport_global.h" +#include "projectpartid.h" + +#include <utils/smallstringio.h> namespace ClangBackEnd { @@ -33,29 +36,26 @@ class PrecompiledHeadersUpdatedMessage { public: PrecompiledHeadersUpdatedMessage() = default; - PrecompiledHeadersUpdatedMessage(ProjectPartPch projectPartPch) + PrecompiledHeadersUpdatedMessage(ProjectPartId projectPartId) { - projectPartPchs.push_back(projectPartPch); + projectPartIds.push_back(projectPartId); } - PrecompiledHeadersUpdatedMessage(ProjectPartPchs &&projectPartPchs) - : projectPartPchs(std::move(projectPartPchs)) + PrecompiledHeadersUpdatedMessage(ProjectPartIds &&projectPartIds) + : projectPartIds(std::move(projectPartIds)) {} - ProjectPartPchs takeProjectPartPchs() const - { - return std::move(projectPartPchs); - } + ProjectPartIds takeProjectPartIds() const { return std::move(projectPartIds); } friend QDataStream &operator<<(QDataStream &out, const PrecompiledHeadersUpdatedMessage &message) { - out << message.projectPartPchs; + out << message.projectPartIds; return out; } friend QDataStream &operator>>(QDataStream &in, PrecompiledHeadersUpdatedMessage &message) { - in >> message.projectPartPchs; + in >> message.projectPartIds; return in; } @@ -63,16 +63,13 @@ public: friend bool operator==(const PrecompiledHeadersUpdatedMessage &first, const PrecompiledHeadersUpdatedMessage &second) { - return first.projectPartPchs == second.projectPartPchs; + return first.projectPartIds == second.projectPartIds; } - PrecompiledHeadersUpdatedMessage clone() const - { - return PrecompiledHeadersUpdatedMessage(Utils::clone(projectPartPchs)); - } + PrecompiledHeadersUpdatedMessage clone() const { return *this; } public: - ProjectPartPchs projectPartPchs; + ProjectPartIds projectPartIds; }; CLANGSUPPORT_EXPORT QDebug operator<<(QDebug debug, const PrecompiledHeadersUpdatedMessage &message); diff --git a/src/libs/clangsupport/projectpartid.h b/src/libs/clangsupport/projectpartid.h index c372682baf..fc5f659605 100644 --- a/src/libs/clangsupport/projectpartid.h +++ b/src/libs/clangsupport/projectpartid.h @@ -54,7 +54,7 @@ public: return first.projectPathId < second.projectPathId; } - friend QDataStream &operator<<(QDataStream &out, const ProjectPartId &projectPathId) + friend QDataStream &operator<<(QDataStream &out, ProjectPartId projectPathId) { out << projectPathId.projectPathId; diff --git a/src/libs/clangsupport/projectpartpch.cpp b/src/libs/clangsupport/projectpartpch.cpp index aac672441c..9c870ac572 100644 --- a/src/libs/clangsupport/projectpartpch.cpp +++ b/src/libs/clangsupport/projectpartpch.cpp @@ -29,8 +29,7 @@ namespace ClangBackEnd { QDebug operator<<(QDebug debug, const ProjectPartPch &projectPartPch) { - debug.nospace() << "FileContainer(" << projectPartPch.projectPartId.projectPathId << ", " - << projectPartPch.pchPath << ")"; + debug.nospace() << "FileContainer(" << projectPartPch.projectPartId.projectPathId << ")"; return debug; } diff --git a/src/libs/clangsupport/projectpartpch.h b/src/libs/clangsupport/projectpartpch.h index c471b46b16..213247ae42 100644 --- a/src/libs/clangsupport/projectpartpch.h +++ b/src/libs/clangsupport/projectpartpch.h @@ -74,8 +74,7 @@ public: friend bool operator==(const ProjectPartPch &first, const ProjectPartPch &second) { - return first.projectPartId == second.projectPartId - && first.pchPath == second.pchPath; + return first.projectPartId == second.projectPartId && first.pchPath == second.pchPath; } ProjectPartPch clone() const diff --git a/src/libs/clangsupport/projectpartpchproviderinterface.h b/src/libs/clangsupport/projectpartpchproviderinterface.h deleted file mode 100644 index 282e541cfd..0000000000 --- a/src/libs/clangsupport/projectpartpchproviderinterface.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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 "projectpartpch.h" - -#include <utils/optional.h> - -namespace ClangBackEnd { - -class ProjectPartPchProviderInterface -{ -public: - ProjectPartPchProviderInterface() = default; - ProjectPartPchProviderInterface(const ProjectPartPchProviderInterface &) = delete; - ProjectPartPchProviderInterface &operator=(const ProjectPartPchProviderInterface &) = delete; - - virtual Utils::optional<ClangBackEnd::ProjectPartPch> projectPartPch( - ClangBackEnd::ProjectPartId projectPartId) const = 0; - virtual const ClangBackEnd::ProjectPartPchs &projectPartPchs() const = 0; - - -protected: - ~ProjectPartPchProviderInterface() = default; -}; - -} // namespace ClangBackEnd |