clang-tools 19.0.0git
Public Member Functions | List of all members
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 222 of file Symbol.h.

Constructor & Destructor Documentation

◆ Builder()

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

Definition at line 224 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 231 of file Symbol.h.

References ID.

Referenced by clang::clangd::SymbolCollector::finish().

◆ 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 234 of file Symbol.h.

References ID.

Referenced by clang::clangd::SymbolCollector::finish(), clang::clangd::SymbolCollector::handleDeclOccurrence(), and clang::clangd::SymbolCollector::handleMacroOccurrence().

◆ 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::own().

Referenced by clang::clangd::SymbolCollector::finish(), clang::clangd::MergedIndex::fuzzyFind(), clang::clangd::generateSymbols(), clang::clangd::FileShardedIndex::getShard(), clang::clangd::SymbolCollector::handleMacroOccurrence(), and clang::clangd::SymbolCollector::handleMacros().


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