Clang: Clean up CompilerOptionsBuilder

No behavior change.

* Remove virtual from methods that are not overridden
* Move constant member functions that do no access any members into
  source file as static functions
* Remove QLatin1String where possible
* Make variable names a bit more consistent
* Other minor stuff

Change-Id: I34a582d5a468489e11365507b283e9aee157664f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-11-30 10:34:05 +01:00
parent ce9f503691
commit 0c38e3aea7
12 changed files with 228 additions and 276 deletions

View File

@@ -189,7 +189,7 @@ private:
static AnalyzeUnits toAnalyzeUnits(const FileInfos &fileInfos)
{
AnalyzeUnits unitsToAnalyze;
const CompilerOptionsBuilder::PchUsage pchUsage = CppTools::getPchUsage();
const UsePrecompiledHeaders usePrecompiledHeaders = CppTools::getPchUsage();
for (const FileInfo &fileInfo : fileInfos) {
CompilerOptionsBuilder optionsBuilder(*fileInfo.projectPart,
CppTools::UseSystemHeader::No,
@@ -198,7 +198,7 @@ static AnalyzeUnits toAnalyzeUnits(const FileInfos &fileInfos)
QString(CLANG_VERSION),
QString(CLANG_RESOURCE_DIR));
QStringList arguments = extraClangToolsPrependOptions();
arguments.append(optionsBuilder.build(fileInfo.kind, pchUsage));
arguments.append(optionsBuilder.build(fileInfo.kind, usePrecompiledHeaders));
arguments.append(extraClangToolsAppendOptions());
unitsToAnalyze << AnalyzeUnit(fileInfo.file.toString(), arguments);
}