9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REF_H 10 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REF_H 14 #include "clang/Index/IndexSymbol.h" 15 #include "llvm/ADT/DenseMap.h" 16 #include "llvm/Support/StringSaver.h" 17 #include "llvm/Support/raw_ostream.h" 30 Declaration =
static_cast<uint8_t
>(index::SymbolRole::Declaration),
31 Definition = static_cast<uint8_t>(index::SymbolRole::Definition),
32 Reference =
static_cast<uint8_t
>(index::SymbolRole::Reference),
37 return static_cast<RefKind>(
static_cast<uint8_t
>(L) |
38 static_cast<uint8_t>(R));
42 return static_cast<RefKind>(
static_cast<uint8_t
>(A) &
43 static_cast<uint8_t>(B));
65 llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
const Ref &);
72 using value_type = std::pair<SymbolID, llvm::ArrayRef<Ref>>;
84 size_t numRefs()
const {
return NumRefs; }
88 return sizeof(*this) +
Arena.getTotalMemory() +
102 llvm::BumpPtrAllocator
Arena;
103 llvm::UniqueStringSaver UniqueStrings;
104 llvm::DenseMap<SymbolID, std::set<Ref>>
Refs;
110 :
Arena(std::move(Arena)),
Refs(std::move(Refs)), NumRefs(NumRefs) {}
112 llvm::BumpPtrAllocator
Arena;
113 std::vector<value_type>
Refs;
121 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REF_H
An efficient structure of storing large set of symbol references in memory.
bool operator==(const HoverInfo::Param &LHS, const HoverInfo::Param &RHS)
Represents a symbol occurrence in the source file.
DeclRelationSet operator &(DeclRelation L, DeclRelation R)
const_iterator begin() const
llvm::BumpPtrAllocator Arena
DeclRelationSet operator|(DeclRelation L, DeclRelation R)
bool operator<(const Ref &L, const Ref &R)
SymbolLocation Location
The source location where the symbol is named.
size_t size() const
Gets the number of symbols.
RefKind
Describes the kind of a cross-reference.
RefSlab::Builder is a mutable container that can 'freeze' to RefSlab.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
const_iterator end() const
std::vector< value_type >::const_iterator const_iterator
std::pair< SymbolID, llvm::ArrayRef< Ref > > value_type
IncludeGraphNode::SourceFlag & operator|=(IncludeGraphNode::SourceFlag &A, IncludeGraphNode::SourceFlag B)