clang-tools  14.0.0git
Classes | Public Member Functions | List of all members
clang::clangd::TUScheduler::HeaderIncluderCache Class Reference

A map from header files to an opened "proxy" file that includes them. More...

Public Member Functions

 HeaderIncluderCache ()
 
void update (PathRef MainFile, llvm::ArrayRef< std::string > Headers)
 
void remove (PathRef MainFile)
 
std::string get (PathRef Header) const
 Get the mainfile associated with Header, or the empty string if none. More...
 
size_t getUsedBytes () const
 

Detailed Description

A map from header files to an opened "proxy" file that includes them.

If you open the header, the compile command from the proxy file is used.

This inclusion information could also naturally live in the index, but there are advantages to using open files instead:

Implementation details:

All methods are threadsafe. In practice, update() comes from preamble threads, remove()s mostly from the main thread, and get() from ASTWorker. Writes are rare and reads are cheap, so we don't expect much contention.

Definition at line 210 of file TUScheduler.cpp.

Constructor & Destructor Documentation

◆ HeaderIncluderCache()

clang::clangd::TUScheduler::HeaderIncluderCache::HeaderIncluderCache ( )
inline

Definition at line 267 of file TUScheduler.cpp.

References Arena.

Member Function Documentation

◆ get()

std::string clang::clangd::TUScheduler::HeaderIncluderCache::get ( PathRef  Header) const
inline

Get the mainfile associated with Header, or the empty string if none.

Definition at line 294 of file TUScheduler.cpp.

◆ getUsedBytes()

size_t clang::clangd::TUScheduler::HeaderIncluderCache::getUsedBytes ( ) const
inline

Definition at line 299 of file TUScheduler.cpp.

◆ remove()

void clang::clangd::TUScheduler::HeaderIncluderCache::remove ( PathRef  MainFile)
inline

Definition at line 286 of file TUScheduler.cpp.

References MainFile.

◆ update()

void clang::clangd::TUScheduler::HeaderIncluderCache::update ( PathRef  MainFile,
llvm::ArrayRef< std::string >  Headers 
)
inline

Definition at line 273 of file TUScheduler.cpp.

References MainFile.


The documentation for this class was generated from the following file: