]> granicus.if.org Git - clang/commit
[Tooling] Do not restore working dir in ClangTool
authorIlya Biryukov <ibiryukov@google.com>
Wed, 29 Aug 2018 16:35:31 +0000 (16:35 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 29 Aug 2018 16:35:31 +0000 (16:35 +0000)
commit6509b6d9b60034ff5d77b7a0223c135b125b0639
treefbd499cf38da1aef52d87f56bad5686e996c1093
parentf7e11f2036908c7a0c73fe19a2670f9e2bd77197
[Tooling] Do not restore working dir in ClangTool

Summary:
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 usually have the same working directory.

Changing working directory is a global operation, so we end up
changing working directory in the middle of running other actions,
which leads to spurious compile errors.

Reviewers: ioeric, sammccall

Reviewed By: ioeric

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D51407

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340937 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Tooling/Tooling.h
lib/Tooling/Tooling.cpp