[cfe-dev] What is the status of clang-based service architecture?

Douglas Gregor dgregor at apple.com
Fri Dec 7 14:14:23 PST 2012


On Dec 7, 2012, at 2:07 PM, Sean Silva <silvas at purdue.edu> wrote:

>> Right. We need a virtual file system that can be shared among the various
>> Clang instances executing within the service. All of Clang's filesystem
>> operations should go through that virtual file system, which (obviously)
>> needs to provide thread-safe access.
> 
> Out of curiosity, is it feasible for clangd to just shepherd separate
> processes for each instance that needs a different view of the
> filesystem? Implementing a whole VFS just to run independent instances
> inside the same process doesn't seem to make sense. I mean, the
> separate instances aren't communicating, right?


It's feasible, but it's necessarily useful. We want all of the compilation/syntax checking/etc. jobs to go into the same clangd server process so that we can start sharing resources, e.g., the underlying buffers for header files that are read by many different translation units. And we want to know when those buffers no longer reflect what's in disk or in the user's IDE, which may invalidate certain results that are cached in the service.

clangd isn't about compiling a bunch of different translation units to object code through a server rather than separate processes, it's about having a stateful server that can answer questions like "what code completions are valid at foo.cpp:55:4?" efficiently from relatively dumb clients.

	- Doug



More information about the cfe-dev mailing list