Clang: Update symbol database if file has changed

The code in the symbol indexer is quite similar, but still different
enough to prevent easy reuse of the function.

Change-Id: I47907d90066da922eafe8ff3cce124ea47ea4a0a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-02-06 11:16:29 +01:00
parent dfb9e4355f
commit 29a4419c07
15 changed files with 256 additions and 6 deletions

View File

@@ -83,6 +83,13 @@ public:
}
}
Utils::optional<ProjectPartArtefact> fetchProjectPartArtefact(FilePathId sourceId) const override
{
ReadStatement &statement = m_statementFactory.getProjectPartCompilerArgumentsAndMacroNames;
return statement.template value<ProjectPartArtefact, 3>(sourceId.filePathId);
}
void insertOrUpdateUsedMacros(const UsedMacros &usedMacros) override
{
WriteStatement &insertStatement = m_statementFactory.insertIntoNewUsedMacrosStatement;
@@ -112,6 +119,12 @@ public:
ReadStatement &getProjectPartIdStatement = m_statementFactory.getProjectPartIdStatement;
int projectPartId = getProjectPartIdStatement.template value<int>(projectPartName).value();
updateProjectPartSources(projectPartId, sourceFilePathIds);
}
void updateProjectPartSources(int projectPartId,
const FilePathIds &sourceFilePathIds) override
{
WriteStatement &deleteStatement = m_statementFactory.deleteAllProjectPartsSourcesWithProjectPartIdStatement;
deleteStatement.write(projectPartId);