forked from qt-creator/qt-creator
Clang: Add file cache
The database is using file path integer ids to handle file paths because otherwise we would save many redundant data. This patch is improving it further with the introduction of a database based file path cache. The entries are now divided in a directory path and file name. This is quite handy for directory based file watching. Change-Id: I03f2e388e43f3d521d6bf8e39dfb95eb2309dc73 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "clangrefactoringbackend_global.h"
|
||||
|
||||
#include <filepathcachingfwd.h>
|
||||
#include <sourcelocationscontainer.h>
|
||||
|
||||
#include <clang/Tooling/Refactoring.h>
|
||||
@@ -40,27 +41,31 @@ namespace ClangBackEnd {
|
||||
class SymbolLocationFinderAction
|
||||
{
|
||||
public:
|
||||
SymbolLocationFinderAction(FilePathCachingInterface &filePathCache)
|
||||
: m_filePathCache(filePathCache)
|
||||
{}
|
||||
|
||||
std::unique_ptr<clang::ASTConsumer> newASTConsumer();
|
||||
std::unique_ptr<clang::ASTConsumer> newASTConsumer();
|
||||
|
||||
SourceLocationsContainer takeSourceLocations()
|
||||
{
|
||||
return std::move(m_sourceLocations);
|
||||
}
|
||||
SourceLocationsContainer takeSourceLocations()
|
||||
{
|
||||
return std::move(m_sourceLocations);
|
||||
}
|
||||
|
||||
void setUnifiedSymbolResolutions(std::vector<USRName> &&unifiedSymbolResolutions)
|
||||
{
|
||||
m_unifiedSymbolResolutions_ = std::move(unifiedSymbolResolutions);
|
||||
}
|
||||
void setUnifiedSymbolResolutions(std::vector<USRName> &&unifiedSymbolResolutions)
|
||||
{
|
||||
m_unifiedSymbolResolutions_ = std::move(unifiedSymbolResolutions);
|
||||
}
|
||||
|
||||
const std::vector<USRName> &unifiedSymbolResolutions() const
|
||||
{
|
||||
return m_unifiedSymbolResolutions_;
|
||||
}
|
||||
const std::vector<USRName> &unifiedSymbolResolutions() const
|
||||
{
|
||||
return m_unifiedSymbolResolutions_;
|
||||
}
|
||||
|
||||
private:
|
||||
ClangBackEnd::SourceLocationsContainer m_sourceLocations;
|
||||
std::vector<USRName> m_unifiedSymbolResolutions_;
|
||||
ClangBackEnd::SourceLocationsContainer m_sourceLocations;
|
||||
std::vector<USRName> m_unifiedSymbolResolutions_;
|
||||
FilePathCachingInterface &m_filePathCache;
|
||||
};
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
|
||||
Reference in New Issue
Block a user