ClangCodeModel: Speed up compilation db generation

We needlessly re-evaluated the same compiler options again and again for
all files in a project part.
Now we only do the actual file-related work per file. Along the way, we
dissolved some unneeded classes and made CompilerOptionsBuilder non-
polymorphic.

Change-Id: I9710d641a57032936cc0812515974dbc91676c8c
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-05-04 16:48:48 +02:00
parent ae93978af1
commit 7ef5001076
9 changed files with 104 additions and 191 deletions

View File

@@ -80,11 +80,13 @@ void ClangCodeModelPlugin::generateCompilationDB()
if (!projectInfo)
return;
const CppEditor::ClangDiagnosticConfig warningsConfig
= warningsConfigForProject(target->project());
QFuture<GenerateCompilationDbResult> task
= QtConcurrent::run(&Internal::generateCompilationDB, projectInfo,
projectInfo->buildRoot(), CompilationDbPurpose::Project,
warningsConfigForProject(target->project()),
optionsForProject(target->project()));
warningsConfig,
optionsForProject(target->project(), warningsConfig));
Core::ProgressManager::addTask(task, tr("Generating Compilation DB"), "generate compilation db");
m_generatorWatcher.setFuture(task);
}