24 return OS << llvm::StringRef(S).rtrim(
'|');
28 return OS << S.Scope << S.Name;
36 return std::log(S.References);
40 auto It = llvm::partition_point(Symbols,
41 [&](
const Symbol &S) {
return S.ID <
ID; });
42 if (It != Symbols.end() && It->ID ==
ID)
53 own(Symbols[S.ID] = S, UniqueStrings);
58 std::vector<Symbol> SortedSymbols;
59 SortedSymbols.reserve(Symbols.size());
60 for (
auto &
Entry : Symbols)
61 SortedSymbols.push_back(std::move(
Entry.second));
62 llvm::sort(SortedSymbols,
66 return SymbolSlab(std::move(Arena), std::move(SortedSymbols));
71 llvm::StringRef Sep =
"";
72 for (
const auto &S : Slab) {
std::vector< llvm::StringRef > Strings
void insert(const Symbol &S)
Adds a symbol, overwriting any existing one with the same ID.
SymbolSlab build() &&
Consumes the builder to finalize the slab.
An immutable symbol container that stores a set of symbols.
const_iterator find(const SymbolID &SymID) const
std::vector< Symbol >::const_iterator const_iterator
void visitStrings(Symbol &S, const Callback &CB)
Invokes Callback with each StringRef& contained in the Symbol.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
static void own(Symbol &S, llvm::UniqueStringSaver &Strings)
float quality(const Symbol &S)
Computes query-independent quality score for a Symbol.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
The class presents a C++ symbol, e.g.
@ IndexedForCodeCompletion
Whether or not this symbol is meant to be used for the code completion.
@ Deprecated
Indicates if the symbol is deprecated.
SymbolID ID
The ID of the symbol.