Commit 2a651bf4 authored by Tobias Hunger's avatar Tobias Hunger

GccToolChain: Invalidate caches on toolchain changes

Change-Id: I91a69631d0417beb35574a5725da6b5a5e411113
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent d8afb51c
......@@ -177,6 +177,13 @@ QList<HeaderPath> GccToolChain::gccHeaderPaths(const FileName &gcc, const QStrin
return systemHeaderPaths;
}
void GccToolChain::toolChainUpdated()
{
m_predefinedMacrosCache->invalidate();
m_headerPathsCache->invalidate();
ToolChain::toolChainUpdated();
}
static QList<Abi> guessGccAbi(const QString &m, const ProjectExplorer::Macros &macros)
{
QList<Abi> abiList;
......
......@@ -104,6 +104,12 @@ public:
return checkImpl(compilerArguments);
}
void invalidate()
{
QMutexLocker locker(&m_mutex);
m_cache.clear();
}
private:
Utils::optional<T> checkImpl(const QStringList &compilerArguments)
{
......@@ -217,6 +223,7 @@ protected:
bool m_doesEnable = false;
bool m_triggered = false;
};
void toolChainUpdated() override;
private:
explicit GccToolChain(Detection d);
......
......@@ -158,7 +158,7 @@ protected:
explicit ToolChain(Core::Id typeId, Detection d);
explicit ToolChain(const ToolChain &);
void toolChainUpdated();
virtual void toolChainUpdated();
// Make sure to call this function when deriving!
virtual bool fromMap(const QVariantMap &data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment