16 return OS <<
"Unknown";
17 static constexpr std::array<const char *, 3>
Messages = {
"Decl",
"Def",
19 bool VisitedOnce =
false;
20 for (
unsigned I = 0; I < Messages.size(); ++I) {
21 if (static_cast<uint8_t>(K) & 1u << I) {
42 M.insert(std::move(R));
48 std::vector<std::pair<SymbolID, llvm::ArrayRef<Ref>>> Result;
49 Result.reserve(Refs.size());
51 for (
auto &Sym : Refs) {
52 std::vector<Ref> SymRefs(Sym.second.begin(), Sym.second.end());
53 NumRefs += SymRefs.size();
54 Result.emplace_back(Sym.first, llvm::ArrayRef<Ref>(SymRefs).copy(Arena));
56 return RefSlab(std::move(Result), std::move(Arena), NumRefs);
An efficient structure of storing large set of symbol references in memory.
Represents a symbol occurrence in the source file.
SymbolLocation Location
The source location where the symbol is named.
RefKind
Describes the kind of a cross-reference.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
void insert(const SymbolID &ID, const Ref &S)
Adds a ref to the slab. Deep copy: Strings will be owned by the slab.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
RefSlab build() &&
Consumes the builder to finalize the slab.