Go to the documentation of this file.
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOLID_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOLID_H
12 #include "llvm/ADT/Hashing.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
15 #include "llvm/Support/raw_ostream.h"
35 explicit SymbolID(llvm::StringRef USR);
38 return HashValue == Sym.HashValue;
42 return HashValue < Sym.HashValue;
48 llvm::StringRef
raw()
const;
52 std::string
str()
const;
53 static llvm::Expected<SymbolID>
fromStr(llvm::StringRef);
56 explicit operator bool()
const {
return !
isNull(); }
59 std::array<uint8_t, RawSize> HashValue{};
65 "size_t longer than SHA1!");
67 memcpy(&Result,
ID.raw().data(),
sizeof(
size_t));
68 return llvm::hash_code(Result);
98 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOLID_H
Some operations such as code completion produce a set of candidates.
static bool isEqual(const clang::clangd::SymbolID &LHS, const clang::clangd::SymbolID &RHS)
bool operator<(const SymbolID &Sym) const
static unsigned getHashValue(const clang::clangd::SymbolID &Sym)
llvm::hash_code hash_value(const SymbolID &ID)
static clang::clangd::SymbolID getEmptyKey()
constexpr static size_t RawSize
std::array< uint8_t, 20 > SymbolID
bool operator==(const SymbolID &Sym) const
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
static clang::clangd::SymbolID getTombstoneKey()
static SymbolID fromRaw(llvm::StringRef)
static llvm::Expected< SymbolID > fromStr(llvm::StringRef)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::raw_string_ostream OS
bool operator!=(const SymbolID &Sym) const
llvm::StringRef raw() const