clang-tools 20.0.0git
|
Base class for threadsafe cache of data read from a file on disk. More...
#include <FileCache.h>
Protected Member Functions | |
FileCache (PathRef Path) | |
void | read (const ThreadsafeFS &TFS, std::chrono::steady_clock::time_point FreshTime, llvm::function_ref< void(std::optional< llvm::StringRef >)> Parse, llvm::function_ref< void()> Read) const |
PathRef | path () const |
Base class for threadsafe cache of data read from a file on disk.
We want configuration files to be "live" as much as possible. Reading them every time is simplest, but caching solves a few problems:
We still read and parse the data synchronously on demand, but skip as much work as possible:
Caches for particular data (e.g. compilation databases) should inherit and:
Definition at line 40 of file FileCache.h.
|
protected |
Definition at line 25 of file FileCache.cpp.
|
inlineprotected |
Definition at line 63 of file FileCache.h.
Referenced by clang::clangd::config::FileConfigCache::get().
|
protected |
Definition at line 31 of file FileCache.cpp.
References clang::clangd::CacheDiskMismatch, clang::clangd::FileNotFound, and clang::clangd::Read.
Referenced by clang::clangd::config::FileConfigCache::get().