clang-tools  10.0.0svn
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. More...
 
void erase (const SymbolID &ID)
 Removes the symbol with an ID, if it exists. More...
 
const Symbolfind (const SymbolID &ID)
 Returns the symbol with an ID, if it exists. Valid until insert/remove. More...
 
SymbolSlab build () &&
 Consumes the builder to finalize the slab. More...
 

Detailed Description

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

The frozen SymbolSlab will use less memory.

Definition at line 199 of file Symbol.h.

Constructor & Destructor Documentation

◆ Builder()

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

Definition at line 201 of file Symbol.h.

Member Function Documentation

◆ build()

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

Consumes the builder to finalize the slab.

Definition at line 54 of file Symbol.cpp.

References clang::clangd::Symbol::ID, clang::clangd::own(), Strings, 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 208 of file Symbol.h.

References Symbols.

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

References Arena, and Symbols.

◆ 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 50 of file Symbol.cpp.

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

Referenced by clang::clangd::BackgroundIndexRebuilderTest::checkRebuild(), clang::clangd::generateSymbols(), clang::clangd::runFuzzyFind(), and clang::clangd::IncludeFixer::unresolvedNameRecorder().


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