clang-tools 19.0.0git
Classes | Public Member Functions | List of all members
clang::clangd::FileShardedIndex Struct Reference

Takes slabs coming from a TU (multiple files) and shards them per declaration location. More...

#include <FileIndex.h>

Public Member Functions

 FileShardedIndex (IndexFileIn Input)
 HintPath is used to convert file URIs stored in symbols into absolute paths.
 
std::vector< llvm::StringRef > getAllSources () const
 Returns uris for all files that has a shard.
 
std::optional< IndexFileIngetShard (llvm::StringRef Uri) const
 Generates index shard for the Uri.
 

Detailed Description

Takes slabs coming from a TU (multiple files) and shards them per declaration location.

Definition at line 170 of file FileIndex.h.

Constructor & Destructor Documentation

◆ FileShardedIndex()

clang::clangd::FileShardedIndex::FileShardedIndex ( IndexFileIn  Input)
explicit

HintPath is used to convert file URIs stored in symbols into absolute paths.

Definition at line 127 of file FileIndex.cpp.

References clang::clangd::IndexFileIn::Refs, clang::clangd::IndexFileIn::Relations, clang::clangd::IndexFileIn::Sources, and clang::clangd::IndexFileIn::Symbols.

Member Function Documentation

◆ getAllSources()

std::vector< llvm::StringRef > clang::clangd::FileShardedIndex::getAllSources ( ) const

Returns uris for all files that has a shard.

Definition at line 182 of file FileIndex.cpp.

Referenced by clang::clangd::FileIndex::updatePreamble().

◆ getShard()

std::optional< IndexFileIn > clang::clangd::FileShardedIndex::getShard ( llvm::StringRef  Uri) const

Generates index shard for the Uri.

Note that this function results in a copy of all the relevant data. Returned index will always have Symbol/Refs/Relation Slabs set, even if they are empty.

Definition at line 193 of file FileIndex.cpp.

References clang::clangd::IndexFileIn::Cmd, clang::clangd::RelationSlab::Builder::insert(), clang::clangd::SymbolSlab::Builder::insert(), clang::clangd::RefSlab::Builder::insert(), clang::clangd::IndexFileIn::Refs, clang::clangd::IndexFileIn::Relations, clang::clangd::IndexFileIn::Sources, and clang::clangd::IndexFileIn::Symbols.

Referenced by clang::clangd::FileIndex::updatePreamble().


The documentation for this struct was generated from the following files: