forked from qt-creator/qt-creator
Clang: Use PCHs for indexing
As generating the AST is quite expensive it would be very useful to cache the not changed include. So we generate PCHs for include outside of a project part. With this change this PCHs are used by the indexer. For that they are save to the symbol database by the PCH manager and when fetched by the symbol indexer. Change-Id: I7a5b07cfb32d72d50dc52d2b108cd41727a7bfc7 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -40,9 +40,9 @@ namespace ClangBackEnd {
|
||||
template <typename StatementFactory>
|
||||
class SymbolStorage final : public SymbolStorageInterface
|
||||
{
|
||||
using ReadStatement = typename StatementFactory::ReadStatementType;
|
||||
using WriteStatement = typename StatementFactory::WriteStatementType;
|
||||
using Database = typename StatementFactory::DatabaseType;
|
||||
using ReadStatement = typename StatementFactory::ReadStatement;
|
||||
using WriteStatement = typename StatementFactory::WriteStatement;
|
||||
using Database = typename StatementFactory::Database;
|
||||
|
||||
public:
|
||||
SymbolStorage(StatementFactory &statementFactory,
|
||||
@@ -87,8 +87,8 @@ public:
|
||||
WriteStatement &updateStatement = m_statementFactory.updateProjectPartStatement;
|
||||
updateStatement.write(compilerArguementsAsJson,
|
||||
compilerMacrosAsJson,
|
||||
projectPartName,
|
||||
includeSearchPathsAsJason);
|
||||
includeSearchPathsAsJason,
|
||||
projectPartName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,6 +252,11 @@ public:
|
||||
m_statementFactory.deleteNewLocationsTableStatement.execute();
|
||||
}
|
||||
|
||||
Utils::optional<ProjectPartPch> fetchPrecompiledHeader(int projectPartId) const
|
||||
{
|
||||
return m_statementFactory.getPrecompiledHeader.template value<ProjectPartPch, 2>(projectPartId);
|
||||
}
|
||||
|
||||
SourceLocationEntries sourceLocations() const
|
||||
{
|
||||
return SourceLocationEntries();
|
||||
|
||||
Reference in New Issue
Block a user