Files
qt-creator/src/plugins/clangtools/clangtoolrunner.h
Jarek Kobus 97a66067bb TaskTree: Prepare for de-utils-ization - part 2
Move TaskTree into Tasking namespace.
Move Tasking namespace out of Utils namespace.

Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 08:09:19 +00:00

59 lines
1.6 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "clangfileinfo.h"
#include "clangtoolssettings.h"
#include <cppeditor/clangdiagnosticconfig.h>
#include <utils/environment.h>
namespace Tasking { class TaskItem; }
namespace ClangTools {
namespace Internal {
struct AnalyzeUnit
{
AnalyzeUnit(const FileInfo &fileInfo,
const Utils::FilePath &clangResourceDir,
const QString &clangVersion);
Utils::FilePath file;
QStringList arguments; // without file itself and "-o somePath"
};
using AnalyzeUnits = QList<AnalyzeUnit>;
struct AnalyzeInputData
{
CppEditor::ClangToolType tool = CppEditor::ClangToolType::Tidy;
RunSettings runSettings;
CppEditor::ClangDiagnosticConfig config;
Utils::FilePath outputDirPath;
Utils::Environment environment;
AnalyzeUnit unit;
QString overlayFilePath = {};
};
struct AnalyzeOutputData
{
bool success = true;
Utils::FilePath fileToAnalyze;
Utils::FilePath outputFilePath;
CppEditor::ClangToolType toolType;
QString errorMessage = {};
QString errorDetails = {};
};
using AnalyzeSetupHandler = std::function<bool()>;
using AnalyzeOutputHandler = std::function<void(const AnalyzeOutputData &)>;
Tasking::TaskItem clangToolTask(const AnalyzeInputData &input,
const AnalyzeSetupHandler &setupHandler,
const AnalyzeOutputHandler &outputHandler);
} // namespace Internal
} // namespace ClangTools