clang-tools  8.0.0
Public Member Functions | List of all members
clang::clangd::MergedIndex Class Reference

#include <Merge.h>

Inheritance diagram for clang::clangd::MergedIndex:
[legend]
Collaboration diagram for clang::clangd::MergedIndex:
[legend]

Public Member Functions

 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...
 
void refs (const RefsRequest &, llvm::function_ref< void(const Ref &)>) const override
 Finds all occurrences (e.g. More...
 
size_t estimateMemoryUsage () const override
 Returns estimated size of index (in bytes). More...
 
- Public Member Functions inherited from clang::clangd::SymbolIndex
virtual ~SymbolIndex ()=default
 

Detailed Description

Definition at line 31 of file Merge.h.

Constructor & Destructor Documentation

◆ MergedIndex()

clang::clangd::MergedIndex::MergedIndex ( const SymbolIndex Dynamic,
const SymbolIndex Static 
)
inline

Definition at line 37 of file Merge.h.

References fuzzyFind(), lookup(), and refs().

Member Function Documentation

◆ estimateMemoryUsage()

size_t clang::clangd::MergedIndex::estimateMemoryUsage ( ) const
inlineoverridevirtual

Returns estimated size of index (in bytes).

Implements clang::clangd::SymbolIndex.

Definition at line 46 of file Merge.h.

References clang::clangd::SymbolIndex::estimateMemoryUsage().

◆ fuzzyFind()

bool clang::clangd::MergedIndex::fuzzyFind ( const FuzzyFindRequest Req,
llvm::function_ref< void(const Symbol &)>  Callback 
) const
overridevirtual

Matches symbols in the index fuzzily and applies Callback on each matched symbol before returning.

If returned Symbols are used outside Callback, they must be deep-copied!

Returns true if there may be more results (limited by Req.Limit).

Implements clang::clangd::SymbolIndex.

Definition at line 25 of file Merge.cpp.

Referenced by MergedIndex().

◆ lookup()

void clang::clangd::MergedIndex::lookup ( const LookupRequest Req,
llvm::function_ref< void(const Symbol &)>  Callback 
) const
overridevirtual

Looks up symbols with any of the given symbol IDs and applies Callback on each matched symbol.

The returned symbol must be deep-copied if it's used outside Callback.

Implements clang::clangd::SymbolIndex.

Definition at line 65 of file Merge.cpp.

Referenced by MergedIndex().

◆ refs()

void clang::clangd::MergedIndex::refs ( const RefsRequest Req,
llvm::function_ref< void(const Ref &)>  Callback 
) const
overridevirtual

Finds all occurrences (e.g.

references, declarations, definitions) of a symbol and applies Callback on each result.

Results should be returned in arbitrary order. The returned result must be deep-copied if it's used outside Callback.

Implements clang::clangd::SymbolIndex.

Definition at line 87 of file Merge.cpp.

Referenced by MergedIndex().


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