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:
@@ -25,6 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <filepathcachingfwd.h>
|
||||
#include <sourcelocationscontainer.h>
|
||||
|
||||
#include <clang/Tooling/Tooling.h>
|
||||
@@ -45,7 +46,7 @@ class SourceLocationsContainer;
|
||||
class LocationSourceFileCallbacks : public clang::tooling::SourceFileCallbacks
|
||||
{
|
||||
public:
|
||||
LocationSourceFileCallbacks(uint line, uint column);
|
||||
LocationSourceFileCallbacks(uint line, uint column, FilePathCachingInterface &filePathCache);
|
||||
|
||||
bool handleBeginSource(clang::CompilerInstance &compilerInstance,
|
||||
llvm::StringRef fileName) override;
|
||||
@@ -56,11 +57,12 @@ public:
|
||||
bool hasSourceLocations() const;
|
||||
|
||||
private:
|
||||
SourceLocationsContainer sourceLocationsContainer;
|
||||
Utils::SmallString symbolName;
|
||||
MacroPreprocessorCallbacks *macroPreprocessorCallbacks;
|
||||
uint line;
|
||||
uint column;
|
||||
SourceLocationsContainer m_sourceLocationsContainer;
|
||||
Utils::SmallString m_symbolName;
|
||||
MacroPreprocessorCallbacks *m_macroPreprocessorCallbacks;
|
||||
FilePathCachingInterface &m_filePathCache;
|
||||
uint m_line;
|
||||
uint m_column;
|
||||
};
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
|
||||
Reference in New Issue
Block a user