clang-tools  14.0.0git
Public Member Functions | List of all members
clang::clangd::FileIndex Class Reference

This manages symbols from files and an in-memory index on all symbols. More...

#include <FileIndex.h>

Inheritance diagram for clang::clangd::FileIndex:
Inheritance graph
[legend]
Collaboration diagram for clang::clangd::FileIndex:
Collaboration graph
[legend]

Public Member Functions

 FileIndex ()
 
void updatePreamble (PathRef Path, llvm::StringRef Version, ASTContext &AST, std::shared_ptr< Preprocessor > PP, const CanonicalIncludes &Includes)
 Update preamble symbols of file Path with all declarations in AST and macros in PP. More...
 
void updateMain (PathRef Path, ParsedAST &AST)
 Update symbols and references from main file Path with indexMainDecls. More...
 
void profile (MemoryTree &MT) const
 
- Public Member Functions inherited from clang::clangd::MergedIndex
 MergedIndex (const SymbolIndex *Dynamic, const SymbolIndex *Static)
 
bool fuzzyFind (const FuzzyFindRequest &, llvm::function_ref< void(const Symbol &)>) const override
 Matches symbols in the index fuzzily and applies Callback on each matched symbol before returning. More...
 
void lookup (const LookupRequest &, llvm::function_ref< void(const Symbol &)>) const override
 Looks up symbols with any of the given symbol IDs and applies Callback on each matched symbol. More...
 
bool refs (const RefsRequest &, llvm::function_ref< void(const Ref &)>) const override
 Finds all occurrences (e.g. More...
 
void relations (const RelationsRequest &, llvm::function_ref< void(const SymbolID &, const Symbol &)>) const override
 
llvm::unique_function< IndexContents(llvm::StringRef) const > indexedFiles () const override
 
size_t estimateMemoryUsage () const override
 Returns estimated size of index (in bytes). More...
 
- Public Member Functions inherited from clang::clangd::SymbolIndex
virtual ~SymbolIndex ()=default
 
virtual void relations (const RelationsRequest &Req, llvm::function_ref< void(const SymbolID &Subject, const Symbol &Object)> Callback) const =0
 Finds all relations (S, P, O) stored in the index such that S is among Req.Subjects and P is Req.Predicate, and invokes Callback for (S, O) in each. More...
 

Additional Inherited Members

- Public Types inherited from clang::clangd::SymbolIndex
using IndexedFiles = llvm::unique_function< IndexContents(llvm::StringRef) const >
 Returns function which checks if the specified file was used to build this index or not. More...
 

Detailed Description

This manages symbols from files and an in-memory index on all symbols.

FIXME: Expose an interface to remove files that are closed.

Definition at line 111 of file FileIndex.h.

Constructor & Destructor Documentation

◆ FileIndex()

clang::clangd::FileIndex::FileIndex ( )

Definition at line 419 of file FileIndex.cpp.

Member Function Documentation

◆ profile()

void clang::clangd::FileIndex::profile ( MemoryTree MT) const

◆ updateMain()

void clang::clangd::FileIndex::updateMain ( PathRef  Path,
ParsedAST AST 
)

Update symbols and references from main file Path with indexMainDecls.

Definition at line 463 of file FileIndex.cpp.

◆ updatePreamble()

void clang::clangd::FileIndex::updatePreamble ( PathRef  Path,
llvm::StringRef  Version,
ASTContext &  AST,
std::shared_ptr< Preprocessor >  PP,
const CanonicalIncludes Includes 
)

Update preamble symbols of file Path with all declarations in AST and macros in PP.

Definition at line 426 of file FileIndex.cpp.


The documentation for this class was generated from the following files: