10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TUSCHEDULER_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TUSCHEDULER_H 16 #include "llvm/ADT/StringMap.h" 51 unsigned MaxRetainedASTs = 3;
63 TUScheduler(
unsigned AsyncThreadsCount,
bool StorePreamblesInMemory,
65 std::chrono::steady_clock::duration UpdateDebounce,
71 std::vector<std::pair<Path, std::size_t>> getUsedBytesPerFile()
const;
76 std::vector<Path> getFilesWithCachedAST()
const;
82 llvm::unique_function<
void(std::vector<Diag>)> OnUpdated);
109 void runWithPreamble(llvm::StringRef Name,
PathRef File,
114 bool blockUntilIdle(
Deadline D)
const;
126 const bool StorePreamblesInMemory;
127 const std::shared_ptr<PCHContainerOperations> PCHOps;
130 llvm::StringMap<std::unique_ptr<FileData>> Files;
131 std::unique_ptr<ASTCache> IdleASTs;
134 llvm::Optional<AsyncTaskRunner> PreambleTasks;
135 llvm::Optional<AsyncTaskRunner> WorkerThreads;
136 std::chrono::steady_clock::duration UpdateDebounce;
WantDiagnostics
Determines whether diagnostics should be generated for a file snapshot.
Diagnostics must be generated for this snapshot.
std::function< void(PathRef Path, ASTContext &, std::shared_ptr< clang::Preprocessor >)> PreambleParsedCallback
llvm::StringRef PathRef
A typedef to represent a ref to file path.
llvm::unique_function< void(llvm::Expected< T >)> Callback
A Callback<T> is a void function that accepts Expected<T>.
Limits the number of threads that can acquire the lock at the same time.
Configuration of the AST retention policy.
llvm::unique_function< void()> Action
Stores and provides access to parsed AST.
unsigned getDefaultAsyncThreadsCount()
Returns a number of a default async threads to use for TUScheduler.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
A point in time we can wait for.
Handles running tasks for ClangdServer and managing the resources (e.g., preambles and ASTs) for open...
An LRU cache of idle ASTs.
Diagnostics must not be generated for this snapshot.