clang-tools
8.0.0
|
Collect declarations (symbols) from an AST. More...
#include <SymbolCollector.h>
Classes | |
struct | Options |
Public Member Functions | |
SymbolCollector (Options Opts) | |
void | initialize (ASTContext &Ctx) override |
void | setPreprocessor (std::shared_ptr< Preprocessor > PP) override |
bool | handleDeclOccurence (const Decl *D, index::SymbolRoleSet Roles, ArrayRef< index::SymbolRelation > Relations, SourceLocation Loc, index::IndexDataConsumer::ASTNodeInfo ASTNode) override |
bool | handleMacroOccurence (const IdentifierInfo *Name, const MacroInfo *MI, index::SymbolRoleSet Roles, SourceLocation Loc) override |
SymbolSlab | takeSymbols () |
RefSlab | takeRefs () |
void | finish () override |
Static Public Member Functions | |
static bool | shouldCollectSymbol (const NamedDecl &ND, const ASTContext &ASTCtx, const Options &Opts, bool IsMainFileSymbol) |
Returns true is ND should be collected. More... | |
Collect declarations (symbols) from an AST.
It collects most declarations except:
References to main-file symbols are not collected.
See also shouldCollectSymbol(...).
Clients (e.g. clangd) can use SymbolCollector together with index::indexTopLevelDecls to retrieve all symbols when the source file is changed.
Definition at line 44 of file SymbolCollector.h.
clang::clangd::SymbolCollector::SymbolCollector | ( | Options | Opts | ) |
Definition at line 232 of file SymbolCollector.cpp.
|
override |
Definition at line 439 of file SymbolCollector.cpp.
Referenced by takeRefs().
|
override |
Definition at line 293 of file SymbolCollector.cpp.
References D, and shouldCollectSymbol().
Referenced by setPreprocessor().
|
override |
Definition at line 367 of file SymbolCollector.cpp.
Referenced by setPreprocessor().
|
override |
Definition at line 234 of file SymbolCollector.cpp.
References Ctx.
|
inlineoverride |
Definition at line 92 of file SymbolCollector.h.
References D, handleDeclOccurence(), handleMacroOccurence(), Loc, and Name.
|
static |
Returns true is ND
should be collected.
Definition at line 241 of file SymbolCollector.cpp.
References clang::clangd::SymbolCollector::Options::CollectMainFileSymbols, clang::clangd::Enum, and clang::clangd::Namespace.
Referenced by handleDeclOccurence().
|
inline |
Definition at line 107 of file SymbolCollector.h.
References finish().
|
inline |
Definition at line 106 of file SymbolCollector.h.