Clang: Store UsedDefines in the symbol database

We write the new defines in a temporary table and then write every new
entry in the usedDefines table, followed by remove of every entry in
usedDefines which are not in the temporary table but have a file entry in
common with one of the entries in the temporary table. At last we clean up
the temporary table.

Change-Id: Idf11ce8d17ad9ccef490578059fac08409fcc5d9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-01-24 18:06:15 +01:00
parent 5cd64e8049
commit b247c4fdeb
6 changed files with 99 additions and 15 deletions

View File

@@ -83,7 +83,13 @@ public:
void insertOrUpdateUsedDefines(const UsedDefines &usedDefines) override
{
WriteStatement &insertStatement = m_statementFactory.insertIntoNewUsedDefinesStatement;
for (const UsedDefine &usedDefine : usedDefines)
insertStatement.write(usedDefine.filePathId.filePathId, usedDefine.defineName);
m_statementFactory.syncNewUsedDefinesStatement.execute();
m_statementFactory.deleteOutdatedUsedDefinesStatement.execute();
m_statementFactory.deleteNewUsedDefinesTableStatement.execute();
}
void updateProjectPartSources(Utils::SmallStringView projectPartName,