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

@@ -419,10 +419,10 @@ void ClangModelManagerSupport::updateLanguageClient(
});
});
const ClangDiagnosticConfig warningsConfig = warningsConfigForProject(project);
auto future = Utils::runAsync(&Internal::generateCompilationDB, projectInfo, jsonDbDir,
CompilationDbPurpose::CodeModel,
warningsConfigForProject(project),
optionsForProject(project));
warningsConfig, optionsForProject(project, warningsConfig));
generatorWatcher->setFuture(future);
m_generatorSynchronizer.addFuture(future);
}