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" 66 void update(
PathRef Path, std::unique_ptr<SymbolSlab> Slab,
67 std::unique_ptr<RefSlab>
Refs,
68 std::unique_ptr<RelationSlab> Relations,
bool CountReferences);
73 std::unique_ptr<SymbolIndex>
78 struct RefSlabAndCountReferences {
79 std::shared_ptr<RefSlab> Slab;
80 bool CountReferences =
false;
82 mutable std::mutex Mutex;
85 llvm::StringMap<std::shared_ptr<SymbolSlab>> FileToSymbols;
87 llvm::StringMap<RefSlabAndCountReferences> FileToRefs;
89 llvm::StringMap<std::shared_ptr<RelationSlab>> FileToRelations;
101 std::shared_ptr<Preprocessor> PP,
135 using SlabTuple = std::tuple<SymbolSlab, RefSlab, RelationSlab>;
150 #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.