[cfe-dev] [libTooling] Custom vfs::FileSystem for ClangTool

Manuel Klimek klimek at google.com
Thu May 28 03:22:24 PDT 2015

On Thu, May 28, 2015 at 12:12 PM Maciej Poleski <poleski.maciej at gmail.com>

> Dnia czwartek, 28 maja 2015 09:32:04 piszesz:
> > >
> > > The general problem is that I have some file system abstraction in IDE
> > > (KDevelop - DocumentController) and want to provide custom VFS on top
> of
> > > this abstraction for Tooling (possibly ClangTool). This would make file
> > > accesses from Clang be consistent with IDE accesses.
> > >
> >
> > And you're saying it's not possible to set that up by providing the
> > contents of the files in the tooling interfaces for overlay? Can you
> expand
> > on why?
> Using ClangTool::mapVirtualFile? It is possible but I'm a bit worried
> about performance in such a case. This would require loading all input
> files into memory. On big code bases this could be a problem.

I'm doing this in one of the biggest C++ codebases of the world; I can
assure you, this is not a performance problem:
1. the size of the text files is many orders of magnitudes smaller than the
size of the produces AST
2. the time it takes to copy those files is dwarfed by the time it takes to
parse them

> Best Regards
> Maciej Poleski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150528/5b7a9bfa/attachment.html>

More information about the cfe-dev mailing list