kadircet marked an inline comment as done.
kadircet added a comment.

Looking at the current state of `BackgroundIndex`, it has the following 
implementation details:

- Loading of shards from storage
- Storing of shards to storage
- Collecting symbols from a TU
- Sharding of symbol information collected from one translation unit
- Performing all these tasks in a thread pool that can change scheduling 
priority of the thread depending on the task running.

Our requirements from the tool that currently is not possible through 

- Running tasks without lowering scheduling priority
- Blocking until all of the indexing actions finishes

I believe we can achive the first one by adding some options. The second one is 
already possible but it is using a test method we implemented for tests, as you 
mentioned we can just change the name.
Of course the above mentioned solutions would imply exposing that functionality 
to every user of `BackgroundIndex`.

I feel like it is better than exposing rest of the implementation details I 
mentioned in the first section(and also would be a lot faster to implement). 

Comment at: clang-tools-extra/clangd/background-indexer/BackgroundIndexer.cpp:65
+  llvm::sys::path::append(DummyFile, "dummy.cpp");
+  CDB.getCompileCommand(DummyFile);
ilya-biryukov wrote:
> We seem to be fighting with the interface we defined here.
> If we need to support an operation of re-building the index for the 
> underlying CDB, let's add it explicitly.
I should've rather performed this through `enqueue`, will change to use that.

  rG LLVM Github Monorepo



cfe-commits mailing list

Reply via email to