15 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_FILEINDEX_H 16 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_FILEINDEX_H 24 #include "clang/Lex/Preprocessor.h" 65 void update(
PathRef Path, std::unique_ptr<SymbolSlab> Slab,
66 std::unique_ptr<RefSlab>
Refs,
67 std::unique_ptr<RelationSlab>
Relations,
bool CountReferences);
72 std::unique_ptr<SymbolIndex>
77 struct RefSlabAndCountReferences {
78 std::shared_ptr<RefSlab> Slab;
79 bool CountReferences =
false;
81 mutable std::mutex Mutex;
84 llvm::StringMap<std::shared_ptr<SymbolSlab>> FileToSymbols;
86 llvm::StringMap<RefSlabAndCountReferences> FileToRefs;
88 llvm::StringMap<std::shared_ptr<RelationSlab>> FileToRelations;
100 std::shared_ptr<Preprocessor> PP,
134 using SlabTuple = std::tuple<SymbolSlab, RefSlab, RelationSlab>;
149 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_FILEINDEX_H std::tuple< SymbolSlab, RefSlab, RelationSlab > SlabTuple
IndexType
Select between in-memory index implementations, which have tradeoffs.
A container of Symbols from several source files.
This manages symbols from files and an in-memory index on all symbols.
SlabTuple indexMainDecls(ParsedAST &AST)
Retrieves symbols and refs of local top level decls in AST (i.e.
llvm::StringRef PathRef
A typedef to represent a ref to file path.
DuplicateHandling
How to handle duplicated symbols across multiple files.
Maps a definition location onto an #include file, based on a set of filename rules.
std::string Path
A typedef to represent a file path.
Stores and provides access to parsed AST.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
SlabTuple indexHeaderSymbols(ASTContext &AST, std::shared_ptr< Preprocessor > PP, const CanonicalIncludes &Includes)
Idex declarations from AST and macros from PP that are declared in included headers.