Commit 16894251 authored by Nikolai Kosjar's avatar Nikolai Kosjar

ClangStaticAnalyzer: Extract inputAndOutputArgumentsRemoved()

Change-Id: Ie9fbec44006775779280293661eff2ff28f2618a
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 2d8c58f0
......@@ -116,12 +116,8 @@ static void prependTargetTripleIfNotIncludedAndNotEmpty(QStringList *arguments,
}
}
// Removes (1) filePath (2) -o <somePath>.
// Prepends -m64/-m32 argument if not already included.
// Prepends -target if not already included.
static QStringList tweakedArguments(const QString &filePath,
const QStringList &arguments,
const ExtraToolChainInfo &extraParams)
// Removes (1) inputFile (2) -o <somePath>.
QStringList inputAndOutputArgumentsRemoved(const QString &inputFile, const QStringList &arguments)
{
QStringList newArguments;
......@@ -133,7 +129,7 @@ static QStringList tweakedArguments(const QString &filePath,
} else if (argument == QLatin1String("-o")) {
skip = true;
continue;
} else if (QDir::fromNativeSeparators(argument) == filePath) {
} else if (QDir::fromNativeSeparators(argument) == inputFile) {
continue; // TODO: Let it in?
}
......@@ -141,6 +137,14 @@ static QStringList tweakedArguments(const QString &filePath,
}
QTC_CHECK(skip == false);
return newArguments;
}
static QStringList tweakedArguments(const QString &filePath,
const QStringList &arguments,
const ExtraToolChainInfo &extraParams)
{
QStringList newArguments = inputAndOutputArgumentsRemoved(filePath, arguments);
prependWordWidthArgumentIfNotIncluded(&newArguments, extraParams.wordWidth);
prependTargetTripleIfNotIncludedAndNotEmpty(&newArguments, extraParams.targetTriple);
......
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