[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC340937: [Tooling] Do not restore working dir in ClangTool (authored by ibiryukov, committed by ). Changed prior to commit: https://reviews.llvm.org/D51407?vs=163122&id=163127#toc Repository: rC Clang

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL340937: [Tooling] Do not restore working dir in ClangTool (authored by ibiryukov, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D51407 Files:

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 163122. ilya-biryukov added a comment. - Expose getAbsolutePath in the public API Repository: rC Clang https://reviews.llvm.org/D51407 Files: include/clang/Tooling/Tooling.h lib/Tooling/Tooling.cpp Index: lib/Tooling/Tooling.cpp ==

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lg Comment at: lib/Tooling/Tooling.cpp:202 -std::string getAbsolutePath(StringRef File) { +static llvm::Expected getAbsolutePath(vfs::FileSystem &FS, +

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Tooling/Tooling.cpp:419 - } else { -llvm::report_fatal_error("Cannot detect current path: " + - Twine(CWD.getError().message())); ioeric wrote: > ilya-biryukov wrote: > > ioeric

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 163071. ilya-biryukov added a comment. - Use vfs for file accesses - Report errors when getAbsolutePath fails, skip those files Repository: rC Clang https://reviews.llvm.org/D51407 Files: lib/Tooling/Tooling.cpp Index: lib/Tooling/Tooling.cpp =

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Tooling/Tooling.cpp:419 - } else { -llvm::report_fatal_error("Cannot detect current path: " + - Twine(CWD.getError().message())); ilya-biryukov wrote: > ioeric wrote: > > Should we sti

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Tooling/Tooling.cpp:419 - } else { -llvm::report_fatal_error("Cannot detect current path: " + - Twine(CWD.getError().message())); ioeric wrote: > Should we still check if `CWD`

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Tooling/Tooling.cpp:419 - } else { -llvm::report_fatal_error("Cannot detect current path: " + - Twine(CWD.getError().message())); Should we still check if `CWD` is correctly set? Rep

[PATCH] D51407: [Tooling] Do not restore working dir in ClangTool

2018-08-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added reviewers: ioeric, sammccall. Resolve all relative paths before running the tool instead. This fixes the usage of ClangTool in AllTUsExecutor. The executor will try running multiple ClangTool instances in parallel with compile commands that