clang-tools 22.0.0git
clang::clangd::SymbolSlab::Builder Class Reference

SymbolSlab::Builder is a mutable container that can 'freeze' to SymbolSlab. More...

#include <Symbol.h>

Public Member Functions

 Builder ()
void insert (const Symbol &S)
 Adds a symbol, overwriting any existing one with the same ID.
void erase (const SymbolID &ID)
 Removes the symbol with an ID, if it exists.
const Symbolfind (const SymbolID &ID)
 Returns the symbol with an ID, if it exists. Valid until insert/remove.
SymbolSlab build () &&
 Consumes the builder to finalize the slab.

Detailed Description

SymbolSlab::Builder is a mutable container that can 'freeze' to SymbolSlab.

The frozen SymbolSlab will use less memory.

Definition at line 224 of file Symbol.h.

Constructor & Destructor Documentation

◆ Builder()

clang::clangd::SymbolSlab::Builder::Builder ( )
inline

Definition at line 226 of file Symbol.h.

Member Function Documentation

◆ build()

SymbolSlab clang::clangd::SymbolSlab::Builder::build ( ) &&

Consumes the builder to finalize the slab.

Definition at line 56 of file Symbol.cpp.

References clang::clangd::Symbol::ID, and clang::clangd::SymbolSlab::SymbolSlab().

◆ erase()

void clang::clangd::SymbolSlab::Builder::erase ( const SymbolID & ID)
inline

Removes the symbol with an ID, if it exists.

Definition at line 233 of file Symbol.h.

◆ find()

const Symbol * clang::clangd::SymbolSlab::Builder::find ( const SymbolID & ID)
inline

Returns the symbol with an ID, if it exists. Valid until insert/remove.

Definition at line 236 of file Symbol.h.

◆ insert()

void clang::clangd::SymbolSlab::Builder::insert ( const Symbol & S)

Adds a symbol, overwriting any existing one with the same ID.

This is a deep copy: underlying strings will be owned by the slab.

Definition at line 52 of file Symbol.cpp.

References clang::clangd::Symbol::ID, and clang::clangd::own().

Referenced by clang::clangd::createIndex(), clang::clangd::MergedIndex::fuzzyFind(), clang::clangd::generateSymbols(), clang::clangd::FileShardedIndex::getShard(), and clang::clangd::runFuzzyFind().


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