clang-tools
10.0.0
|
A container of Symbols from several source files. More...
#include <FileIndex.h>
Public Member Functions | |
void | update (PathRef Path, std::unique_ptr< SymbolSlab > Slab, std::unique_ptr< RefSlab > Refs, std::unique_ptr< RelationSlab > Relations, bool CountReferences) |
Updates all symbols and refs in a file. More... | |
std::unique_ptr< SymbolIndex > | buildIndex (IndexType, DuplicateHandling DuplicateHandle=DuplicateHandling::PickOne) |
The index keeps the symbols alive. More... | |
A container of Symbols from several source files.
It can be updated at source-file granularity, replacing all symbols from one file with a new set.
This implements a snapshot semantics for symbols in a file. Each update to a file will create a new snapshot for all symbols in the file. Snapshots are managed with shared pointers that are shared between this class and the users. For each file, this class only stores a pointer pointing to the newest snapshot, and an outdated snapshot is deleted by the last owner of the snapshot, either this class or the symbol index.
The snapshot semantics keeps critical sections minimal since we only need locking when we swap or obtain references to snapshots.
Definition at line 61 of file FileIndex.h.
std::unique_ptr< SymbolIndex > clang::clangd::FileSymbols::buildIndex | ( | IndexType | Type, |
DuplicateHandling | DuplicateHandle = DuplicateHandling::PickOne |
||
) |
The index keeps the symbols alive.
Will count Symbol::References based on number of references in the main files, while building the index with DuplicateHandling::Merge option.
Definition at line 127 of file FileIndex.cpp.
References clang::clangd::RelationSlab::bytes(), clang::clangd::RefSlab::bytes(), clang::clangd::Heavy, clang::clangd::Light, clang::clangd::Merge, clang::clangd::mergeSymbol(), clang::clangd::PickOne, and Refs.
Referenced by clang::clangd::FileIndex::updateMain().
void clang::clangd::FileSymbols::update | ( | PathRef | Path, |
std::unique_ptr< SymbolSlab > | Slab, | ||
std::unique_ptr< RefSlab > | Refs, | ||
std::unique_ptr< RelationSlab > | Relations, | ||
bool | CountReferences | ||
) |
Updates all symbols and refs in a file.
If either is nullptr, corresponding data for Path
will be removed. If CountReferences is true, Refs
will be used for counting References during merging.
Definition at line 103 of file FileIndex.cpp.
Referenced by clang::clangd::FileIndex::updateMain().