Commit 752c2cd6 authored by hjk's avatar hjk

ClangStaticAnalyzer: Directly construct RunControl

This only runs directly locally, so there's currently no need to go through
the AnalyzerManager indirection.

Change-Id: Ie241b362b870e8ea0be221c501420573596e34f2
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent cbbdc64e
......@@ -69,7 +69,7 @@ ClangStaticAnalyzerRunControl::ClangStaticAnalyzerRunControl(
RunConfiguration *runConfiguration,
Core::Id runMode,
const ProjectInfo &projectInfo)
: AnalyzerRunControl(runConfiguration, runMode)
: RunControl(runConfiguration, runMode)
, m_projectInfo(projectInfo)
, m_initialFilesToProcessSize(0)
, m_filesAnalyzed(0)
......
......@@ -52,7 +52,7 @@ struct ExtraToolChainInfo {
QString targetTriple;
};
class ClangStaticAnalyzerRunControl : public Debugger::AnalyzerRunControl
class ClangStaticAnalyzerRunControl : public ProjectExplorer::RunControl
{
Q_OBJECT
......@@ -70,6 +70,7 @@ public:
signals:
void newDiagnosticsAvailable(const QList<Diagnostic> &diagnostics);
void starting();
private:
AnalyzeUnits sortedUnitsToAnalyze();
......
......@@ -27,10 +27,6 @@
#include "clangstaticanalyzerconstants.h"
#include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h>
#include <coreplugin/icontext.h>
#include <cpptools/cppmodelmanager.h>
......@@ -47,7 +43,6 @@
#include <utils/qtcassert.h>
using namespace Debugger;
using namespace ProjectExplorer;
namespace ClangStaticAnalyzer {
......@@ -112,7 +107,7 @@ RunControl *ClangStaticAnalyzerRunControlFactory::create(RunConfiguration *runCo
return 0;
}
return Debugger::createAnalyzerRunControl(runConfiguration, runMode);
return m_tool->createRunControl(runConfiguration, runMode);
}
} // namespace Internal
......
......@@ -149,9 +149,6 @@ ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent)
desc.setToolTip(toolTip);
desc.setRunMode(Constants::CLANGSTATICANALYZER_RUN_MODE);
desc.setPerspectiveId(ClangStaticAnalyzerPerspectiveId);
desc.setRunControlCreator([this](RunConfiguration *runConfiguration, Core::Id runMode) {
return createRunControl(runConfiguration, runMode);
});
desc.setCustomToolStarter([this](RunConfiguration *runConfiguration) {
Q_UNUSED(runConfiguration);
startTool();
......@@ -172,8 +169,8 @@ ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent)
this, &ClangStaticAnalyzerTool::updateRunActions);
}
AnalyzerRunControl *ClangStaticAnalyzerTool::createRunControl(RunConfiguration *runConfiguration,
Core::Id runMode)
RunControl *ClangStaticAnalyzerTool::createRunControl(RunConfiguration *runConfiguration,
Core::Id runMode)
{
QTC_ASSERT(runConfiguration, return 0);
QTC_ASSERT(m_projectInfoBeforeBuild.isValid(), return 0);
......
......@@ -25,7 +25,7 @@
#pragma once
#include <debugger/analyzer/analyzermanager.h>
#include <projectexplorer/runconfiguration.h>
#include <cpptools/projectinfo.h>
#include <QHash>
......@@ -56,8 +56,8 @@ public:
bool isRunning() const { return m_running; }
QList<Diagnostic> diagnostics() const;
Debugger::AnalyzerRunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
Core::Id runMode);
ProjectExplorer::RunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
Core::Id runMode);
void startTool();
signals:
......
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