Clangtools: More FilePath

Change-Id: I82057f1a9788043ee45a268ae57847caf6c994f3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-02-07 18:27:59 +01:00
parent 9ad60cd891
commit da7383387d
5 changed files with 11 additions and 12 deletions

View File

@@ -85,7 +85,7 @@ static QStringList clangArguments(const ClangDiagnosticConfig &diagnosticConfig,
return arguments;
}
static QString createOutputFilePath(const FilePath &dirPath, const FilePath &fileToAnalyze)
static FilePath createOutputFilePath(const FilePath &dirPath, const FilePath &fileToAnalyze)
{
const QString fileName = fileToAnalyze.fileName();
const FilePath fileTemplate = dirPath.pathAppended("report-" + fileName + "-XXXXXX");
@@ -95,7 +95,7 @@ static QString createOutputFilePath(const FilePath &dirPath, const FilePath &fil
temporaryFile.setFileTemplate(fileTemplate.path());
if (temporaryFile.open()) {
temporaryFile.close();
return temporaryFile.fileName();
return FilePath::fromString(temporaryFile.fileName());
}
return {};
}
@@ -106,15 +106,15 @@ TaskItem clangToolTask(const AnalyzeInputData &input,
{
struct ClangToolStorage {
QString name;
Utils::FilePath executable;
QString outputFilePath;
FilePath executable;
FilePath outputFilePath;
};
const TreeStorage<ClangToolStorage> storage;
const auto mainToolArguments = [=](const ClangToolStorage *data)
{
QStringList result;
result << "-export-fixes=" + data->outputFilePath;
result << "-export-fixes=" + data->outputFilePath.nativePath();
if (!input.overlayFilePath.isEmpty() && isVFSOverlaySupported(data->executable))
result << "--vfsoverlay=" + input.overlayFilePath;
result << input.unit.file.nativePath();