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

David Blaikie dblaikie at gmail.com
Fri Dec 7 14:13:04 PST 2012


On Fri, 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?
>
> Actually, presumably every "request" to clangd that is dependent on
> the current working directory is going to include a parameter "use
> this as the current working directory", so couldn't we just open
> relative to that path (by just appending the paths)? Why is it
> necessary to (virtually or not) chdir() into a directory to open
> relative paths, compared to just appending them?

I'd assume a VFS is necessary for the IDE scenario where you're
life-compiling code in an editor buffer that's not necessarily
reflected on the concrete filesystem yet.

- David

>
> -- Sean Silva
>
> On Fri, Dec 7, 2012 at 2:15 PM, Douglas Gregor <dgregor at apple.com> wrote:
>>
>> On Dec 7, 2012, at 12:44 AM, Manuel Klimek <klimek at google.com> wrote:
>>
>> On Thu, Dec 6, 2012 at 6:30 PM, Kosztka Imre Dávid <kosztkaid at gmail.com>
>> wrote:
>>>
>>> :(
>>>
>>> Best idea ever! I would like to contribute to it. Who else is interested?
>>
>>
>> The first step is to make clang (more) thread-safe:
>> For example, the file interface is not thread-safe; this requires changes to
>> the file system / path interface to allow keeping state of the working
>> directory, and doing all relative file operations based on that state (on
>> unix fd* versions of the unix file api). This requires an objectification of
>> the file interface first, which requires some more design work.
>>
>>
>> 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.
>>
>> - Doug
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list