16 return OS <<
"Unknown";
17 static const std::vector<const char *>
Messages = {
"Decl",
"Def",
"Ref"};
18 bool VisitedOnce =
false;
19 for (
unsigned I = 0; I < Messages.size(); ++I) {
20 if (static_cast<uint8_t>(K) & 1u << I) {
41 M.insert(std::move(R));
47 std::vector<std::pair<SymbolID, llvm::ArrayRef<Ref>>>
Result;
48 Result.reserve(Refs.size());
50 for (
auto &Sym : Refs) {
51 std::vector<Ref> SymRefs(Sym.second.begin(), Sym.second.end());
52 NumRefs += SymRefs.size();
53 Result.emplace_back(Sym.first, llvm::ArrayRef<Ref>(SymRefs).copy(Arena));
55 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++ -*-===//
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
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.