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" 67 void update(
PathRef Path, std::unique_ptr<SymbolSlab> Slab,
68 std::unique_ptr<RefSlab>
Refs,
69 std::unique_ptr<RelationSlab> Relations,
bool CountReferences);
74 std::unique_ptr<SymbolIndex>
79 struct RefSlabAndCountReferences {
80 std::shared_ptr<RefSlab> Slab;
81 bool CountReferences =
false;
83 mutable std::mutex Mutex;
86 llvm::StringMap<std::shared_ptr<SymbolSlab>> FileToSymbols;
88 llvm::StringMap<RefSlabAndCountReferences> FileToRefs;
90 llvm::StringMap<std::shared_ptr<RelationSlab>> FileToRelations;
102 std::shared_ptr<Preprocessor>
PP,
136 using SlabTuple = std::tuple<SymbolSlab, RefSlab, RelationSlab>;
151 #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)
Index declarations from AST and macros from PP that are declared in included headers.