diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-03-05 10:22:45 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-03-05 10:22:45 +0100 |
commit | 0619de868110586e8a6561ecbc1d62c80da09501 (patch) | |
tree | 1a4364a3660f57d5f10ac5a7471d30e3f555c5f4 /src/tools/clangpchmanagerbackend/source | |
parent | 44886ad65a2226511a6b9a4383189e4ab804e47f (diff) | |
parent | 26f6cbf8b59dffa7f47b315031b7055ec3421315 (diff) | |
download | qt-creator-0619de868110586e8a6561ecbc1d62c80da09501.tar.gz |
Merge remote-tracking branch 'origin/4.9'
Conflicts:
qbs/modules/qtc/qtc.qbs
qtcreator.pri
src/tools/clangpchmanagerbackend/source/taskscheduler.h
Change-Id: I518adaf647df412887c2a372416634359f09ad2a
Diffstat (limited to 'src/tools/clangpchmanagerbackend/source')
3 files changed, 14 insertions, 8 deletions
diff --git a/src/tools/clangpchmanagerbackend/source/precompiledheaderstorage.h b/src/tools/clangpchmanagerbackend/source/precompiledheaderstorage.h index 022f5d926b..7d1069b998 100644 --- a/src/tools/clangpchmanagerbackend/source/precompiledheaderstorage.h +++ b/src/tools/clangpchmanagerbackend/source/precompiledheaderstorage.h @@ -126,6 +126,11 @@ public: return FilePath(""); } + Utils::optional<ProjectPartPch> fetchPrecompiledHeader(int projectPartId) const + { + return m_getPrecompiledHeader.template value<ProjectPartPch, 2>(projectPartId); + } + public: Sqlite::ImmediateNonThrowingDestructorTransaction m_transaction; Database &m_database; @@ -155,6 +160,10 @@ public: "SELECT systemPchPath FROM precompiledHeaders WHERE projectPartId = (SELECT projectPartId " "FROM projectParts WHERE projectPartName = ?)", m_database}; + mutable ReadStatement m_getPrecompiledHeader{ + "SELECT ifnull(nullif(projectPchPath, ''), systemPchPath), " + "projectPchBuildTime FROM precompiledHeaders WHERE projectPartId = ?", + m_database}; }; } diff --git a/src/tools/clangpchmanagerbackend/source/precompiledheaderstorageinterface.h b/src/tools/clangpchmanagerbackend/source/precompiledheaderstorageinterface.h index 2a7e11604b..06833be4a2 100644 --- a/src/tools/clangpchmanagerbackend/source/precompiledheaderstorageinterface.h +++ b/src/tools/clangpchmanagerbackend/source/precompiledheaderstorageinterface.h @@ -25,9 +25,12 @@ #pragma once +#include "projectpartpch.h" + #include <filepath.h> #include <utils/smallstringvector.h> +#include <utils/optional.h> namespace ClangBackEnd { @@ -50,6 +53,7 @@ public: = 0; virtual void deleteSystemPrecompiledHeaders(const Utils::SmallStringVector &projectPartNames) = 0; virtual FilePath fetchSystemPrecompiledHeaderPath(Utils::SmallStringView projectPartName) = 0; + virtual Utils::optional<ProjectPartPch> fetchPrecompiledHeader(int projectPartId) const = 0; protected: ~PrecompiledHeaderStorageInterface() = default; diff --git a/src/tools/clangpchmanagerbackend/source/taskscheduler.h b/src/tools/clangpchmanagerbackend/source/taskscheduler.h index 3d2b03ae97..7ae70c9f66 100644 --- a/src/tools/clangpchmanagerbackend/source/taskscheduler.h +++ b/src/tools/clangpchmanagerbackend/source/taskscheduler.h @@ -30,6 +30,7 @@ #include "queueinterface.h" #include "progresscounter.h" +#include <executeinloop.h> #include <processormanagerinterface.h> #include <symbolindexertaskqueueinterface.h> #include <symbolscollectorinterface.h> @@ -149,14 +150,6 @@ private: m_futures.erase(split, m_futures.end()); } - template <typename Callable> - void executeInLoop(Callable &&callable, QObject *object = QCoreApplication::instance()) { - if (QThread *thread = qobject_cast<QThread*>(object)) - object = QAbstractEventDispatcher::instance(thread); - - QMetaObject::invokeMethod(object, std::forward<Callable>(callable)); - } - private: std::vector<Future> m_futures; ProcessorManager &m_processorManager; |