<div dir="ltr"><br><br><div class="gmail_quote">On Thu, May 28, 2015 at 11:22 AM Maciej Poleski <<a href="mailto:poleski.maciej@gmail.com">poleski.maciej@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dnia czwartek, 28 maja 2015 08:37:19 piszesz:<br>
> On Wed, May 27, 2015 at 10:56 PM Maciej Poleski <<a href="mailto:poleski.maciej@gmail.com" target="_blank">poleski.maciej@gmail.com</a>><br>
> wrote:<br>
><br>
> > Hi<br>
> ><br>
> > I'm looking for some way to customize FileSystem object used by ClangTool<br>
> > (especially in ClangTool::run). This is almost nice:<br>
> > <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__clang.llvm.org_doxygen_Tooling-5F8cpp-5Fsource.html-23l00278&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=FOH9-4031mvM5SSJoVA6NkdYdsUhFVWrOd0EQzHZ2xk&s=Si0KrnNpNPTb1qkn2pvxvsWaOBmxWH9ZeLtCQDrKO50&e=" target="_blank">http://clang.llvm.org/doxygen/Tooling_8cpp_source.html#l00278</a><br>
> > almost, because object is created by implementation without chance to<br>
> > change this behavior (provide my own implementation).<br>
> ><br>
><br>
> Which object?<br>
><br>
> If you want to inject files, you can currently do that.<br>
<br>
My own subclass of vfs::FileSystem (or the whole FileManager).<br>
FileManager is initialized in constructor of ClangTool to "new FileManager(FileSystemOptions())". I want to provide optional second argument to constructor of FileManager.<br>
<br>
><br>
><br>
> > Is there some place in which FileSystem could be replaced?<br>
> ><br>
><br>
> Currently not.<br>
><br>
> I also seen this way of "consuming AST":<br>
> ><br>
> > <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__eli.thegreenplace.net_2012_06_08_basic-2Dsource-2Dto-2Dsource-2Dtransformation-2Dwith-2Dclang_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=FOH9-4031mvM5SSJoVA6NkdYdsUhFVWrOd0EQzHZ2xk&s=Tkf8337Xr9AlrGzoEwJdF7pw-4qOjptP-4ucrpPCc3s&e=" target="_blank">http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang/</a><br>
> > but it's quite old example, and looks "slightly" different than current<br>
> > implementation of ClangTool::run (with its use of ToolInvocation and<br>
> > others).<br>
> ><br>
> > Is there some general solution of this problem?<br>
> ><br>
><br>
> Which problem exactly?<br>
><br>
<br>
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.<br></blockquote><div><br></div><div>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?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best Regards<br>
Maciej Poleski<br>
<br>
</blockquote></div></div>