Clang: Refactor fetchPrecompiledHeader

We don't need the other information any more.

Change-Id: Ie34a646df34e336591c124093a15e90307ac88ec
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2019-04-10 17:44:34 +02:00
parent 5ab057746c
commit 3fc8217113
6 changed files with 32 additions and 30 deletions

View File

@@ -93,20 +93,13 @@ void SymbolIndexer::updateProjectPart(ProjectPartContainer &&projectPart)
Sqlite::DeferredTransaction transaction{m_transactionInterface};
ProjectPartId projectPartId = projectPart.projectPartId;
const Utils::optional<ProjectPartPch> optionalProjectPartPch
= m_precompiledHeaderStorage.fetchPrecompiledHeader(projectPartId);
const FilePath pchPath = m_precompiledHeaderStorage.fetchPrecompiledHeader(projectPartId);
transaction.commit();
using Builder = CommandLineBuilder<ProjectPartContainer, Utils::SmallStringVector>;
Builder commandLineBuilder{projectPart,
projectPart.toolChainArguments,
InputFileType::Source,
{},
{},
optionalProjectPartPch
? FilePathView{optionalProjectPartPch->pchPath}
: FilePathView{}};
Builder commandLineBuilder{
projectPart, projectPart.toolChainArguments, InputFileType::Source, {}, {}, pchPath};
std::vector<SymbolIndexerTask> symbolIndexerTask;
symbolIndexerTask.reserve(projectPart.sourcePathIds.size());
@@ -165,16 +158,14 @@ void SymbolIndexer::updateChangedPath(FilePathId filePathId,
if (!optionalArtefact)
return;
const Utils::optional<ProjectPartPch> optionalProjectPartPch
= m_precompiledHeaderStorage.fetchPrecompiledHeader(optionalArtefact->projectPartId);
const FilePath pchPath = m_precompiledHeaderStorage.fetchPrecompiledHeader(
optionalArtefact->projectPartId);
transaction.commit();
SourceTimeStamps dependentTimeStamps = m_symbolStorage.fetchIncludedIndexingTimeStamps(filePathId);
const ProjectPartArtefact &artefact = *optionalArtefact;
auto pchPath = optionalProjectPartPch ? optionalProjectPartPch->pchPath : FilePath{};
CommandLineBuilder<ProjectPartArtefact, Utils::SmallStringVector>
builder{artefact, artefact.toolChainArguments, InputFileType::Source, {}, {}, pchPath};